aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-02-14 01:59:43 +0800
committerDan <danjm.com@gmail.com>2018-02-14 02:50:24 +0800
commit5e9dc74a59d2507f36e1cb5796f97982f5f4993d (patch)
tree00a3e46390e3d3afc46c928409c0bc7dcf4acd3f
parentb5b16e4ce09b5fa27ce4775b30a44bacea7ee329 (diff)
downloadtangerine-wallet-browser-5e9dc74a59d2507f36e1cb5796f97982f5f4993d.tar
tangerine-wallet-browser-5e9dc74a59d2507f36e1cb5796f97982f5f4993d.tar.gz
tangerine-wallet-browser-5e9dc74a59d2507f36e1cb5796f97982f5f4993d.tar.bz2
tangerine-wallet-browser-5e9dc74a59d2507f36e1cb5796f97982f5f4993d.tar.lz
tangerine-wallet-browser-5e9dc74a59d2507f36e1cb5796f97982f5f4993d.tar.xz
tangerine-wallet-browser-5e9dc74a59d2507f36e1cb5796f97982f5f4993d.tar.zst
tangerine-wallet-browser-5e9dc74a59d2507f36e1cb5796f97982f5f4993d.zip
Remove isInBrowser method and use environment-type.js
-rw-r--r--app/scripts/platforms/extension.js16
-rw-r--r--ui/app/unlock.js10
2 files changed, 4 insertions, 22 deletions
diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js
index 60bcce324..f5cc255d1 100644
--- a/app/scripts/platforms/extension.js
+++ b/app/scripts/platforms/extension.js
@@ -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) => {
diff --git a/ui/app/unlock.js b/ui/app/unlock.js
index db88fa9d0..13c3f1274 100644
--- a/ui/app/unlock.js
+++ b/ui/app/unlock.js
@@ -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',