aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2017-11-30 07:25:10 +0800
committerGitHub <noreply@github.com>2017-11-30 07:25:10 +0800
commitc30b543a8069c3925bb254716699752e38eaf97a (patch)
treed9185abffcb5adfecdd99324b0e2e1e4f1e2b586 /app/scripts/metamask-controller.js
parent23a5ea9321e4046338323e9df9e64d230d057df1 (diff)
parent91817573c95f2a1b234ab9fb7e39ac15ad44741d (diff)
downloadtangerine-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.js14
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(),
+ }
+ }
+ }
+
}