1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Add firstVersion field to notices selector

This commit is contained in:
Dan Finlay 2017-11-28 11:22:09 -08:00
parent e89f82399f
commit ec4b7de962
2 changed files with 5 additions and 1 deletions

View File

@ -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.

View File

@ -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()