mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Only open a new window on restore from seed if in extension view.
This commit is contained in:
parent
96d40ee618
commit
b5b16e4ce0
@ -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) => {
|
||||
|
@ -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())
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user