-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix: show clear offline message when share/upload button clicked without internet #1952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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.", | ||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor gotcha: this Might be cleaner to do the offline guard before calling |
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+32
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block looks like it accidentally includes an extra
Suggested change
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| console.log("Starting upload process..."); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // Check authentication first | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.", | ||
| ); | ||
| return; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same pattern here: returning after the dialog counts as a successful mutation, so Worth guarding |
||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an offline user clicks upload in the overlay, this branch first shows the clear offline dialog and then throws a normal error. This mutation has no local Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/desktop/src/routes/recordings-overlay.tsx
Line: 728
Comment:
**Offline Error Reaches Global Dialog**
When an offline user clicks upload in the overlay, this branch first shows the clear offline dialog and then throws a normal error. This mutation has no local `onError`, so the app-wide mutation handler opens a second native dialog like `Error\nError: No internet connection`, which keeps the generic error popup on the new offline path.
How can I resolve this? If you propose a fix, please make it concise. |
||
|
|
||
| // Check authentication first | ||
| const existingAuth = await authStore.get(); | ||
| if (!existingAuth) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.