Skip to content

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

Merged
merged 5 commits into from
Feb 21, 2018

Conversation

priyank-p
Copy link
Member

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.

@priyank-p priyank-p force-pushed the check-internet branch 5 times, most recently from 2a56db7 to 68dfce6 Compare February 15, 2018 14:56
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",
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

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.
serverManagerView.init();
window.addEventListener('online', () => {
serverManagerView.reloadView();
reconnectUtil.pollInternetAndReload();
Copy link
Member

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.')

Copy link
Member Author

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.");
Copy link
Member

@akashnimare akashnimare Feb 15, 2018

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.');

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cPhost this.

Copy link
Member Author

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 :)

Copy link
Member Author

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.

@akashnimare akashnimare merged commit d48b6ae into zulip:master Feb 21, 2018
@priyank-p priyank-p deleted the check-internet branch February 21, 2018 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants