diff options
Only open a new window on restore from seed if in extension view.
-rw-r--r-- | app/scripts/platforms/extension.js | 16 | ||||
-rw-r--r-- | ui/app/actions.js | 2 | ||||
-rw-r--r-- | ui/app/unlock.js | 7 |
3 files changed, 22 insertions, 3 deletions
diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index f5cc255d1..60bcce324 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -22,6 +22,22 @@ class ExtensionPlatform { this.openWindow({ url: extensionURL }) } + isInBrowser () { + return new Promise((resolve, reject) => { + try { + extension.tabs.getCurrent(currentTab => { + if (currentTab) { + resolve(true) + } else { + resolve(false) + } + }) + } catch (e) { + reject(e) + } + }) + } + getPlatformInfo (cb) { try { extension.runtime.getPlatformInfo((platform) => { diff --git a/ui/app/actions.js b/ui/app/actions.js index c6776eeee..4bc1f379e 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -842,7 +842,6 @@ function showRestoreVault () { function markPasswordForgotten () { return (dispatch) => { - dispatch(actions.showLoadingIndication()) return background.markPasswordForgotten(() => { dispatch(actions.hideLoadingIndication()) dispatch(actions.forgotPassword()) @@ -853,7 +852,6 @@ function markPasswordForgotten () { function unMarkPasswordForgotten () { return (dispatch) => { - dispatch(actions.showLoadingIndication()) return background.unMarkPasswordForgotten(() => { dispatch(actions.hideLoadingIndication()) dispatch(actions.forgotPassword()) diff --git a/ui/app/unlock.js b/ui/app/unlock.js index 4b39bd3e2..db88fa9d0 100644 --- a/ui/app/unlock.js +++ b/ui/app/unlock.js @@ -77,7 +77,12 @@ UnlockScreen.prototype.render = function () { h('p.pointer', { onClick: () => { this.props.dispatch(actions.markPasswordForgotten()) - global.platform.openExtensionInBrowser() + global.platform.isInBrowser() + .then((isInBrowser) => { + if (!isInBrowser) { + global.platform.openExtensionInBrowser() + } + }) }, style: { fontSize: '0.8em', |