From aed1bdff5a25fe05361d4257be325697a6108d42 Mon Sep 17 00:00:00 2001 From: GyDi Date: Mon, 8 Aug 2022 23:16:28 +0800 Subject: [PATCH] fix: list compare wrong --- src/components/setting/mods/clash-field-viewer.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/setting/mods/clash-field-viewer.tsx b/src/components/setting/mods/clash-field-viewer.tsx index a324402..50496ca 100644 --- a/src/components/setting/mods/clash-field-viewer.tsx +++ b/src/components/setting/mods/clash-field-viewer.tsx @@ -76,12 +76,13 @@ const ClashFieldViewer = ({ handler }: Props) => { setOpen(false); const oldSet = new Set([...(data?.valid || []), ...enhanceUse]); - const curSet = new Set(selected.concat([...oldSet])); + const curSet = new Set(selected); + const joinSet = new Set(selected.concat([...oldSet])); - if (curSet.size === oldSet.size) return; + if (curSet.size === oldSet.size && curSet.size === joinSet.size) return; try { - await changeProfileValid([...new Set(selected)]); + await changeProfileValid([...curSet]); mutate(); Notice.success("Refresh clash config", 1000); } catch (err: any) {