Merge pull request #267 from geeeeeeeeek/window-focus-fix

Enhance error handling.
This commit is contained in:
Akash Nimare
2017-08-08 18:06:11 +00:00
committed by GitHub

View File

@@ -109,9 +109,10 @@ class WebView extends BaseComponent {
// Explicit focusing the webview causes a bug the input cannot regain focus on Winodws.
// The bug is introduced from Electron and this is a tempory fix.
// See https://github.com/zulip/zulip-electron/issues/216
if (!this.$el.getWebContents().isFocused()) {
const webContents = this.$el.getWebContents();
if (webContents && !webContents.isFocused()) {
this.$el.focus();
this.$el.getWebContents().focus();
webContents.focus();
}
}