From 978acfa471fabad68a5711d52e1d3448d4637728 Mon Sep 17 00:00:00 2001 From: huzibaca Date: Thu, 24 Oct 2024 11:14:18 +0800 Subject: [PATCH] chore: update --- src/pages/profiles.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/profiles.tsx b/src/pages/profiles.tsx index 4a8b15b1..e6214b83 100644 --- a/src/pages/profiles.tsx +++ b/src/pages/profiles.tsx @@ -66,7 +66,7 @@ const ProfilePage = () => { coordinateGetter: sortableKeyboardCoordinates, }) ); - const { stateCurrent } = location.state || {}; + const { current } = location.state || {}; useEffect(() => { const unlisten = addListener("tauri://file-drop", async (event) => { @@ -184,11 +184,12 @@ const ProfilePage = () => { useEffect(() => { (async () => { - if (stateCurrent && stateCurrent !== profiles.current) { - await activateProfile(stateCurrent, false); + if (current) { + mutateProfiles(); + await activateProfile(current, false); } })(); - }, stateCurrent); + }, current); const onEnhance = useLockFn(async (notifySuccess: boolean) => { setActivatings(currentActivatings());