diff options
Add optional version field to notices
Allows notices to only show to users who are on a certain version.
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index a4c77e468..c1b63449a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -44,6 +44,7 @@ module.exports = class MetamaskController extends EventEmitter { this.opts = opts const initState = opts.initState || {} + this.recordFirstTimeInfo(initState) // platform-specific api this.platform = opts.platform @@ -149,6 +150,7 @@ module.exports = class MetamaskController extends EventEmitter { // notices this.noticeController = new NoticeController({ initState: initState.NoticeController, + version, }) this.noticeController.updateNoticesList() // to be uncommented when retrieving notices from a remote server. @@ -797,4 +799,13 @@ module.exports = class MetamaskController extends EventEmitter { return rpcTarget } + recordFirstTimeInfo (initState) { + if (!('firstTimeInfo' in initState)) { + initState.firstTimeInfo = { + version, + date: Date.now(), + } + } + } + } |