Fix an error where the main page gets blank when adding a server

This commit is contained in:
Yuya Ochiai
2018-05-03 21:17:28 +09:00
parent 5b89bffe00
commit 2df19c4dd7

View File

@@ -227,9 +227,10 @@ const MattermostView = createReactClass({
focusOnWebView() {
const webview = findDOMNode(this.refs.webview);
if (!webview.getWebContents().isFocused()) {
const webContents = webview.getWebContents(); // webContents might not be created yet.
if (webContents && webContents.isFocused()) {
webview.focus();
webview.getWebContents().focus();
webContents.focus();
}
},