From c9a0718acfd42965847397d515356f8dd12fc97e Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Fri, 2 Oct 2026 12:57:43 +0200 Subject: [PATCH] fix: keep the app from closing when a files widget opens it offline #52 --- src/components/files/ShareSheet.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/files/ShareSheet.tsx b/src/components/files/ShareSheet.tsx index 168b7db6..dfad2b2d 100644 --- a/src/components/files/ShareSheet.tsx +++ b/src/components/files/ShareSheet.tsx @@ -98,6 +98,9 @@ export default function ShareSheet({ node, onClose, onChanged }: ShareSheetProps ); const candidates = useMemo(() => { + // The sheet is mounted with the Files tab, before a session may exist + // (an offline cold start): nobody to list yet, and no own id to read. + if (principals.length === 0) return []; const self = ownPrincipalId(); const q = search.trim().toLowerCase(); return principals