From 149448667f50149ac50eb0d3376a4f7045d85f46 Mon Sep 17 00:00:00 2001 From: shashank-sn Date: Mon, 29 Jun 2026 07:46:55 +0530 Subject: [PATCH 1/2] fix: show clear offline message when share/upload button clicked without internet Previously, clicking the share button while offline would silently hang or throw a generic error dialog after the network call timed out. Added a navigator.onLine check at the start of both the editor ShareButton and recordings overlay share flows to show a clear "You appear to be offline" dialog immediately. Fixes #368 Co-authored-by: CommandCodeBot --- apps/desktop/src/routes/editor/ShareButton.tsx | 7 +++++++ apps/desktop/src/routes/recordings-overlay.tsx | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/apps/desktop/src/routes/editor/ShareButton.tsx b/apps/desktop/src/routes/editor/ShareButton.tsx index bebe10b5a3b..9a29c64c7f4 100644 --- a/apps/desktop/src/routes/editor/ShareButton.tsx +++ b/apps/desktop/src/routes/editor/ShareButton.tsx @@ -29,6 +29,13 @@ function ShareButton() { mutationFn: async () => { setUploadState({ type: "idle" }); + if (!navigator.onLine) { + await commands.globalMessageDialog( + "You appear to be offline. Please check your internet connection and try again.", + ); + throw new Error("No internet connection"); + } + console.log("Starting upload process..."); // Check authentication first diff --git a/apps/desktop/src/routes/recordings-overlay.tsx b/apps/desktop/src/routes/recordings-overlay.tsx index ab0a71a1ac5..a52e6f931f2 100644 --- a/apps/desktop/src/routes/recordings-overlay.tsx +++ b/apps/desktop/src/routes/recordings-overlay.tsx @@ -719,6 +719,14 @@ function createRecordingMutations( return; } + // Check connectivity first — prevent hanging on network calls when offline + if (!navigator.onLine) { + await commands.globalMessageDialog( + "You appear to be offline. Please check your internet connection and try again.", + ); + throw new Error("No internet connection"); + } + // Check authentication first const existingAuth = await authStore.get(); if (!existingAuth) { From a47beb891e474780c95644116e46b6cef22e1eec Mon Sep 17 00:00:00 2001 From: shashank-sn Date: Mon, 29 Jun 2026 07:54:24 +0530 Subject: [PATCH 2/2] fix: prevent duplicate error dialog when sharing offline Replace thrown Error with a clean return after the offline dialog, so the mutation's onError/app-wide handler doesn't show a second "Error: No internet connection" popup on top of the friendly message. Co-authored-by: CommandCodeBot --- apps/desktop/src/routes/editor/ShareButton.tsx | 2 +- apps/desktop/src/routes/recordings-overlay.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/routes/editor/ShareButton.tsx b/apps/desktop/src/routes/editor/ShareButton.tsx index 9a29c64c7f4..a53fc08a6a7 100644 --- a/apps/desktop/src/routes/editor/ShareButton.tsx +++ b/apps/desktop/src/routes/editor/ShareButton.tsx @@ -33,7 +33,7 @@ function ShareButton() { await commands.globalMessageDialog( "You appear to be offline. Please check your internet connection and try again.", ); - throw new Error("No internet connection"); + return; } console.log("Starting upload process..."); diff --git a/apps/desktop/src/routes/recordings-overlay.tsx b/apps/desktop/src/routes/recordings-overlay.tsx index a52e6f931f2..a9848daeaf3 100644 --- a/apps/desktop/src/routes/recordings-overlay.tsx +++ b/apps/desktop/src/routes/recordings-overlay.tsx @@ -724,7 +724,7 @@ function createRecordingMutations( await commands.globalMessageDialog( "You appear to be offline. Please check your internet connection and try again.", ); - throw new Error("No internet connection"); + return; } // Check authentication first