diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2017-11-30 07:25:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-30 07:25:10 +0800 |
commit | c30b543a8069c3925bb254716699752e38eaf97a (patch) | |
tree | d9185abffcb5adfecdd99324b0e2e1e4f1e2b586 /app/scripts/metamask-controller.js | |
parent | 23a5ea9321e4046338323e9df9e64d230d057df1 (diff) | |
parent | 91817573c95f2a1b234ab9fb7e39ac15ad44741d (diff) | |
download | tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.gz tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.bz2 tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.lz tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.xz tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.tar.zst tangerine-wallet-browser-c30b543a8069c3925bb254716699752e38eaf97a.zip |
Merge pull request #2630 from MetaMask/i2624-VersionedNoticesv3.12.1
Versioned notices
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index f9b7b4182..130ad1471 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -45,6 +45,7 @@ module.exports = class MetamaskController extends EventEmitter { this.opts = opts const initState = opts.initState || {} + this.recordFirstTimeInfo(initState) // platform-specific api this.platform = opts.platform @@ -150,6 +151,8 @@ module.exports = class MetamaskController extends EventEmitter { // notices this.noticeController = new NoticeController({ initState: initState.NoticeController, + version, + firstVersion: initState.firstTimeInfo.version, }) this.noticeController.updateNoticesList() // to be uncommented when retrieving notices from a remote server. @@ -484,7 +487,7 @@ module.exports = class MetamaskController extends EventEmitter { vault = await this.keyringController.fullUpdate() } else { - let vault = await this.keyringController.createNewVaultAndKeychain(password) + vault = await this.keyringController.createNewVaultAndKeychain(password) this.selectFirstIdentity(vault) } release() @@ -798,4 +801,13 @@ module.exports = class MetamaskController extends EventEmitter { return rpcTarget } + recordFirstTimeInfo (initState) { + if (!('firstTimeInfo' in initState)) { + initState.firstTimeInfo = { + version, + date: Date.now(), + } + } + } + } |