-
-
Notifications
You must be signed in to change notification settings - Fork 473
reconnect: Check wheather internet is working before reloading. #415
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
Conversation
2a56db7
to
68dfce6
Compare
app/package.json
Outdated
@@ -32,6 +32,7 @@ | |||
"electron-spellchecker": "1.1.2", | |||
"electron-updater": "2.18.2", | |||
"electron-window-state": "4.1.1", | |||
"is-online": "^7.0.0", |
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.
Should bt the exact working version here.
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.
Done
68dfce6
to
a6fcdf4
Compare
When online event is triggered check weather the internet is atually working or not. Commonly on windows it turns out that internet takes couple of seconds to boot up after connecting to internet or in some cases this might be they have to sign in to internet service portal in order to access internet.
a6fcdf4
to
e7ac78d
Compare
serverManagerView.init(); | ||
window.addEventListener('online', () => { | ||
serverManagerView.reloadView(); | ||
reconnectUtil.pollInternetAndReload(); |
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.
Is there a need for adding a console log, just to make the debugging better (for issues like https://github.com/zulip/zulip-electron/issues/312) -
console.log('You're back online.')
console.log('No internet connection, you are offline.')
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.
Ah yeah, so its easier to figure out.
if (!this.alreadyReloaded) { | ||
this.serverManagerView.reloadView(); | ||
} | ||
console.log("You're back online."); |
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.
console.log('You're back online.');
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.
@cPhost this.
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.
Ah. i forgot to git add
this :)
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 though if you had an '
inside a string that needs to escaped we can use double quotes.
bc1bd8e
to
34968f9
Compare
34968f9
to
3115549
Compare
When online event is triggered check weather the internet is atually working or not.
Commonly on windows it turns out that internet takes couple of seconds to boot up after
connecting to internet or in some cases this might be they have to sign in to internet service
portal in order to access internet.