-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: handle onLine events better #246
base: main
Are you sure you want to change the base?
Conversation
Keep in mind the |
I'm well aware, this is just some boilerplate to deal with ahead of time before I get something proper out. I'm not sure if pinging a good domain is the best course of action, since being able to connect to e.g. IMO the best course of action would be to deal with connection issues where they occurt (e.g. how its done in |
Mostly agree here, but I do think we should check a list of known good domains i.e |
since I'm already working on extending this, should there be anything else added? |
I was thinking it'd make sense to have a function like
Hmm, it might be worth adding a "no connection" type icon in the window buttons, something like this or similar, and either a tooltip informing the user of them being offline and or having it be clickable to make it show the offline toast? I'm not aware of any other buttons that'd need disabling, which aren't already...
I would personally skip it, if |
agreed, lets clarify how this function should behave There are some URLs from various groups (Microsoft and KDE come to mind) that have a predefined string available at a HTTP only url to check if everything is fine and dandy
Just tested with my internet disconnected, the
might be best to disable it when offline? |
Perhaps add some options to it, i.e ok_options = {
// decides whether the body should be checked against anything
body: false,
// decides whether the response code should be anything specific
code: false,
// decides whether to attempt to parse the body as JSON
is_json: false,
} Other options could of course be added.
Ah, yeah, might be a good idea, perhaps |
online
andoffline
so we can dynamically respond if the users internet changes.set_buttons(true)
from theno-internet
event because it would give back control to the user while things are still being worked on