|
|
@ -13,12 +13,15 @@ module.exports = class NoticeController extends EventEmitter { |
|
|
|
this.firstVersion = opts.firstVersion |
|
|
|
this.firstVersion = opts.firstVersion |
|
|
|
this.version = opts.version |
|
|
|
this.version = opts.version |
|
|
|
const initState = extend({ |
|
|
|
const initState = extend({ |
|
|
|
noticesList: this._filterNotices(hardCodedNotices), |
|
|
|
noticesList: [], |
|
|
|
}, opts.initState) |
|
|
|
}, opts.initState) |
|
|
|
this.store = new ObservableStore(initState) |
|
|
|
this.store = new ObservableStore(initState) |
|
|
|
|
|
|
|
// setup memStore
|
|
|
|
this.memStore = new ObservableStore({}) |
|
|
|
this.memStore = new ObservableStore({}) |
|
|
|
this.store.subscribe(() => this._updateMemstore()) |
|
|
|
this.store.subscribe(() => this._updateMemstore()) |
|
|
|
this._updateMemstore() |
|
|
|
this._updateMemstore() |
|
|
|
|
|
|
|
// pull in latest notices
|
|
|
|
|
|
|
|
this.updateNoticesList() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getNoticesList () { |
|
|
|
getNoticesList () { |
|
|
@ -84,8 +87,8 @@ module.exports = class NoticeController extends EventEmitter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async _retrieveNoticeData () { |
|
|
|
async _retrieveNoticeData () { |
|
|
|
// Placeholder for the API.
|
|
|
|
// Placeholder for remote notice API.
|
|
|
|
return [] |
|
|
|
return hardCodedNotices |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_updateMemstore () { |
|
|
|
_updateMemstore () { |
|
|
|