From 164a5782120f96b0121136df4c52d7b5fdb2617b Mon Sep 17 00:00:00 2001 From: Grace Date: Wed, 24 Jun 2026 11:12:04 +0100 Subject: [PATCH] Remove editor-not-ready reload on app resume - The resume handler reloaded the app when the editor wasn't ready. It was recovery for an editor loading issue that has since been fixed, so it's no longer needed. - It also broke deep links: on a warm-start deep link, appUrlOpen navigates to the target route and resume fires right after, so the reload raced the navigation and reset the app to the home page. Removing it fixes the intermittent "opens the app but doesn't navigate" behaviour. --- src/hooks/project-hooks.tsx | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/hooks/project-hooks.tsx b/src/hooks/project-hooks.tsx index cb17cde82..bae5daada 100644 --- a/src/hooks/project-hooks.tsx +++ b/src/hooks/project-hooks.tsx @@ -562,7 +562,6 @@ export const ProjectProvider = ({ [downloadActions, saveHex] ); - const isEditorReady = useStore((s) => s.isEditorReady); // Native app URL open handler (e.g. opening a .hex file). useEffect(() => { if (Capacitor.isNativePlatform()) { @@ -602,26 +601,11 @@ export const ProjectProvider = ({ } ); - const resumeListener = CapacitorApp.addListener("resume", () => { - if (!isEditorReady) { - logging.log("Editor not ready when resuming app, reloading..."); - window.location.reload(); - } - }); - return () => { void appUrlListener.then((l) => l.remove()); - void resumeListener.then((l) => l.remove()); }; } - }, [ - driverRef, - editorReady, - importProjectFromHexText, - isEditorReady, - logging, - setLoadingOverlayVisible, - ]); + }, [importProjectFromHexText, setLoadingOverlayVisible]); const value = useMemo( () => ({