diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-11-29 03:22:09 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-11-29 03:22:09 +0800 |
commit | ec4b7de962d0c4913f8f65a21a6cbef9f2ebc261 (patch) | |
tree | e0c972bf538154a1e700655eb77affdc38273ef9 /app/scripts | |
parent | e89f82399f1c732c40dc644c496795833691cff0 (diff) | |
download | tangerine-wallet-browser-ec4b7de962d0c4913f8f65a21a6cbef9f2ebc261.tar tangerine-wallet-browser-ec4b7de962d0c4913f8f65a21a6cbef9f2ebc261.tar.gz tangerine-wallet-browser-ec4b7de962d0c4913f8f65a21a6cbef9f2ebc261.tar.bz2 tangerine-wallet-browser-ec4b7de962d0c4913f8f65a21a6cbef9f2ebc261.tar.lz tangerine-wallet-browser-ec4b7de962d0c4913f8f65a21a6cbef9f2ebc261.tar.xz tangerine-wallet-browser-ec4b7de962d0c4913f8f65a21a6cbef9f2ebc261.tar.zst tangerine-wallet-browser-ec4b7de962d0c4913f8f65a21a6cbef9f2ebc261.zip |
Add firstVersion field to notices selector
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/metamask-controller.js | 1 | ||||
-rw-r--r-- | app/scripts/notice-controller.js | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index c1b63449a..0c759010b 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -151,6 +151,7 @@ module.exports = class MetamaskController extends EventEmitter { 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. diff --git a/app/scripts/notice-controller.js b/app/scripts/notice-controller.js index bc545127e..457161ccb 100644 --- a/app/scripts/notice-controller.js +++ b/app/scripts/notice-controller.js @@ -9,7 +9,7 @@ module.exports = class NoticeController extends EventEmitter { constructor (opts) { super() this.noticePoller = null - this.version = opts.version + this.firstVersion = opts.firstVersion const initState = extend({ noticesList: [], }, opts.initState) @@ -58,6 +58,9 @@ module.exports = class NoticeController extends EventEmitter { if ('version' in newNotice) { return semver.satisfies(this.version, newNotice.version) } + if ('firstVersion' in newNotice) { + return semver.satisfies(this.firstVersion, newNotice.firstVersion) + } return true }) var oldNotices = this.getNoticesList() |