fix: list compare wrong
This commit is contained in:
parent
929c840006
commit
aed1bdff5a
@ -76,12 +76,13 @@ const ClashFieldViewer = ({ handler }: Props) => {
|
|||||||
setOpen(false);
|
setOpen(false);
|
||||||
|
|
||||||
const oldSet = new Set([...(data?.valid || []), ...enhanceUse]);
|
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 {
|
try {
|
||||||
await changeProfileValid([...new Set(selected)]);
|
await changeProfileValid([...curSet]);
|
||||||
mutate();
|
mutate();
|
||||||
Notice.success("Refresh clash config", 1000);
|
Notice.success("Refresh clash config", 1000);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
Loading…
Reference in New Issue
Block a user