-
Notifications
You must be signed in to change notification settings - Fork 40
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
Detect offline client #126
Detect offline client #126
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, let's use a toast for this!
} catch (error) { | ||
throw error; // Rethrow for retries | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this outside the function and before the useOfflineCheck
function?
@@ -0,0 +1,28 @@ | |||
|
|||
|
|||
export const OfllineStatusModal = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to use a non-dismissable toast for this (src/components/ui/sonner.tsx
).
See here how that can be done.
If you do that you also don't need any changes to index.tsx
and play.tsx
.
Also small note: avoid reformatting the code, as that introduces a lot of irrelevant changes to the diff :)
(We will soon introduce linting to avoid these issues.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh nice, I didn't know a component like that exists. I'll check it out and make necessary changes.
For the reformatting I think I have eslint + prettier setup on my IDE. I'll disable it for this project.
Context (Problem, Motivation, Solution)
Link related issues!
#35
Describe Your Changes
Checklist
make check
and fixed resulting issuesTesting
I implemented a modal to display when our app is offline. so how did i test this, i tested this by throttling the network in my devtools and also disconneCTING my device from wifi and this modal appears on the
index.tsx
andplay.tsx
page. when i toggle back or reconnect, the modal disaappearsCc: @norswap