fix: list compare wrong

This commit is contained in:
GyDi 2022-08-08 23:16:28 +08:00
parent 929c840006
commit aed1bdff5a
No known key found for this signature in database
GPG Key ID: 1C95E0D3467B3084

View File

@ -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) {