From 624eb2a2bafec75086c646f7013e68153be2bfe4 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Wed, 24 Jul 2024 14:25:06 +0800 Subject: [PATCH] chore: prepend new added rules --- src/components/profile/groups-editor-viewer.tsx | 2 +- src/components/profile/proxies-editor-viewer.tsx | 2 +- src/components/profile/rules-editor-viewer.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/profile/groups-editor-viewer.tsx b/src/components/profile/groups-editor-viewer.tsx index f3cf7a8..40771ad 100644 --- a/src/components/profile/groups-editor-viewer.tsx +++ b/src/components/profile/groups-editor-viewer.tsx @@ -723,7 +723,7 @@ export const GroupsEditorViewer = (props: Props) => { throw new Error(t("Group Name Already Exists")); } } - setPrependSeq([...prependSeq, formIns.getValues()]); + setPrependSeq([formIns.getValues(), ...prependSeq]); } catch (err: any) { Notice.error(err.message || err.toString()); } diff --git a/src/components/profile/proxies-editor-viewer.tsx b/src/components/profile/proxies-editor-viewer.tsx index 797dedc..ca65709 100644 --- a/src/components/profile/proxies-editor-viewer.tsx +++ b/src/components/profile/proxies-editor-viewer.tsx @@ -276,7 +276,7 @@ export const ProxiesEditorViewer = (props: Props) => { startIcon={} onClick={() => { let proxies = handleParse(); - setPrependSeq([...prependSeq, ...proxies]); + setPrependSeq([...proxies, ...prependSeq]); }} > {t("Prepend Proxy")} diff --git a/src/components/profile/rules-editor-viewer.tsx b/src/components/profile/rules-editor-viewer.tsx index c3e95fc..92abf2f 100644 --- a/src/components/profile/rules-editor-viewer.tsx +++ b/src/components/profile/rules-editor-viewer.tsx @@ -543,7 +543,7 @@ export const RulesEditorViewer = (props: Props) => { try { let raw = validateRule(); if (prependSeq.includes(raw)) return; - setPrependSeq([...prependSeq, raw]); + setPrependSeq([raw, ...prependSeq]); } catch (err: any) { Notice.error(err.message || err.toString()); }