diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2018-11-23 03:06:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-23 03:06:46 +0800 |
commit | be3619cd802536894097d81e7f31d38b0c2b3e9f (patch) | |
tree | 2591ff5a9fe64f2dbd9fa089f5c51e8d0141be24 /app/scripts/controllers/preferences.js | |
parent | 337a4e1b4ea7a560d773bc262b2adffd1617a39b (diff) | |
parent | 804b273cec61246f0d23efd461ccd2cc5c64bf22 (diff) | |
download | tangerine-wallet-browser-be3619cd802536894097d81e7f31d38b0c2b3e9f.tar tangerine-wallet-browser-be3619cd802536894097d81e7f31d38b0c2b3e9f.tar.gz tangerine-wallet-browser-be3619cd802536894097d81e7f31d38b0c2b3e9f.tar.bz2 tangerine-wallet-browser-be3619cd802536894097d81e7f31d38b0c2b3e9f.tar.lz tangerine-wallet-browser-be3619cd802536894097d81e7f31d38b0c2b3e9f.tar.xz tangerine-wallet-browser-be3619cd802536894097d81e7f31d38b0c2b3e9f.tar.zst tangerine-wallet-browser-be3619cd802536894097d81e7f31d38b0c2b3e9f.zip |
Merge pull request #5793 from MetaMask/develop
Bring master up to date with develop
Diffstat (limited to 'app/scripts/controllers/preferences.js')
-rw-r--r-- | app/scripts/controllers/preferences.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index eaeaee499..b21cdfb36 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -32,7 +32,10 @@ class PreferencesController { tokens: [], suggestedTokens: {}, useBlockie: false, - featureFlags: {}, + featureFlags: { + betaUI: true, + skipAnnounceBetaUI: true, + }, currentLocale: opts.initLangCode, identities: {}, lostIdentities: {}, @@ -46,7 +49,7 @@ class PreferencesController { this.diagnostics = opts.diagnostics this.network = opts.network this.store = new ObservableStore(initState) - this.showWatchAssetUi = opts.showWatchAssetUi + this.openPopup = opts.openPopup this._subscribeProviderType() } // PUBLIC METHODS @@ -567,7 +570,7 @@ class PreferencesController { } const tokenOpts = { rawAddress, decimals, symbol, image } this.addSuggestedERC20Asset(tokenOpts) - return this.showWatchAssetUi().then(() => { + return this.openPopup().then(() => { const tokenAddresses = this.getTokens().filter(token => token.address === normalizeAddress(rawAddress)) return tokenAddresses.length > 0 }) @@ -583,8 +586,8 @@ class PreferencesController { */ _validateERC20AssetParams (opts) { const { rawAddress, symbol, decimals } = opts - if (!rawAddress || !symbol || !decimals) throw new Error(`Cannot suggest token without address, symbol, and decimals`) - if (!(symbol.length < 6)) throw new Error(`Invalid symbol ${symbol} more than five characters`) + if (!rawAddress || !symbol || typeof decimals === 'undefined') throw new Error(`Cannot suggest token without address, symbol, and decimals`) + if (!(symbol.length < 7)) throw new Error(`Invalid symbol ${symbol} more than six characters`) const numDecimals = parseInt(decimals, 10) if (isNaN(numDecimals) || numDecimals > 36 || numDecimals < 0) { throw new Error(`Invalid decimals ${decimals} must be at least 0, and not over 36`) |