From 6e58d49207d66498bb616678fdc5b409cdfb6ef1 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 6 Feb 2026 21:53:09 +0700 Subject: [PATCH] Update files --- packages/app/src/app/settings.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/app/src/app/settings.tsx b/packages/app/src/app/settings.tsx index a775dca0a..d98443ae3 100644 --- a/packages/app/src/app/settings.tsx +++ b/packages/app/src/app/settings.tsx @@ -422,6 +422,9 @@ export default function SettingsScreen() { const isMountedRef = useRef(true); const lastHandledEditHostRef = useRef(null); const appVersion = Constants.expoConfig?.version ?? (Constants as any).manifest?.version ?? "0.1.0"; + const editingDaemonLive = editingDaemon + ? daemons.find((daemon) => daemon.serverId === editingDaemon.serverId) ?? null + : null; const pendingNameHostname = useSessionStore( useCallback( (state) => { @@ -507,6 +510,12 @@ export default function SettingsScreen() { pendingEditReopenServerId, ]); + useEffect(() => { + if (!editingDaemon) return; + if (editingDaemonLive) return; + handleCloseEditDaemon(); + }, [editingDaemon, editingDaemonLive, handleCloseEditDaemon]); + const handleSaveEditDaemon = useCallback(async () => { if (!editingDaemon) return; if (isSavingEdit) return; @@ -765,11 +774,11 @@ export default function SettingsScreen() { /> - {editingDaemon ? ( + {editingDaemonLive ? ( Connections - {editingDaemon.connections.map((conn) => { + {editingDaemonLive.connections.map((conn) => { const title = conn.type === "relay" ? `Relay (${conn.relayEndpoint})` @@ -794,7 +803,7 @@ export default function SettingsScreen() { {title} void handleRemoveConnection(editingDaemon.serverId, conn.id)} + onPress={() => void handleRemoveConnection(editingDaemonLive.serverId, conn.id)} > Remove