1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00

Remove isInBrowser method and use environment-type.js

This commit is contained in:
Dan 2018-02-13 14:29:43 -03:30
parent b5b16e4ce0
commit 5e9dc74a59
2 changed files with 4 additions and 22 deletions

View File

@ -22,22 +22,6 @@ 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) => {

View File

@ -6,6 +6,7 @@ const actions = require('./actions')
const getCaretCoordinates = require('textarea-caret')
const EventEmitter = require('events').EventEmitter
const { OLD_UI_NETWORK_TYPE } = require('../../app/scripts/config').enums
const environmentType = require('../../app/scripts/lib/environment-type')
const Mascot = require('./components/mascot')
@ -77,12 +78,9 @@ UnlockScreen.prototype.render = function () {
h('p.pointer', {
onClick: () => {
this.props.dispatch(actions.markPasswordForgotten())
global.platform.isInBrowser()
.then((isInBrowser) => {
if (!isInBrowser) {
global.platform.openExtensionInBrowser()
}
})
if (environmentType() === 'popup') {
global.platform.openExtensionInBrowser()
}
},
style: {
fontSize: '0.8em',