From 041522f94e017643cfa823e8f84d58c11db9fd9f Mon Sep 17 00:00:00 2001 From: dongchengjie <37543964+dongchengjie@users.noreply.github.com> Date: Sat, 29 Jun 2024 11:22:11 +0800 Subject: [PATCH] fix: do not reactive when changed profile is not current --- src/pages/profiles.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/profiles.tsx b/src/pages/profiles.tsx index edb0ba8e..1bd7f62f 100644 --- a/src/pages/profiles.tsx +++ b/src/pages/profiles.tsx @@ -429,7 +429,9 @@ const ProfilePage = () => { onSelect={(f) => onSelect(item.uid, f)} onEdit={() => viewerRef.current?.edit(item)} onChange={async (prev, curr) => { - prev !== curr && (await onEnhance()); + if (prev !== curr && profiles.current === item.uid) { + await onEnhance(); + } }} onDelete={() => onDelete(item.uid)} /> @@ -466,7 +468,9 @@ const ProfilePage = () => { onMoveEnd={() => onMoveEnd(item.uid)} onEdit={() => viewerRef.current?.edit(item)} onChange={async (prev, curr) => { - prev !== curr && (await onEnhance()); + if (prev !== curr && chain.includes(item.uid)) { + await onEnhance(); + } }} />