diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-12-21 08:45:22 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-12-21 08:45:22 +0800 |
commit | aea263a80d373841f89cd1ef895b80781d2f78f7 (patch) | |
tree | bdbefb423cfee444d8054c90d780f34dc7169c4f /app | |
parent | 572980402d9c9f0cf92554ef616707554236c728 (diff) | |
download | tangerine-wallet-browser-aea263a80d373841f89cd1ef895b80781d2f78f7.tar tangerine-wallet-browser-aea263a80d373841f89cd1ef895b80781d2f78f7.tar.gz tangerine-wallet-browser-aea263a80d373841f89cd1ef895b80781d2f78f7.tar.bz2 tangerine-wallet-browser-aea263a80d373841f89cd1ef895b80781d2f78f7.tar.lz tangerine-wallet-browser-aea263a80d373841f89cd1ef895b80781d2f78f7.tar.xz tangerine-wallet-browser-aea263a80d373841f89cd1ef895b80781d2f78f7.tar.zst tangerine-wallet-browser-aea263a80d373841f89cd1ef895b80781d2f78f7.zip |
Lint.
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/notice-controller.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/app/scripts/notice-controller.js b/app/scripts/notice-controller.js index 438f5c27e..00c87c670 100644 --- a/app/scripts/notice-controller.js +++ b/app/scripts/notice-controller.js @@ -9,7 +9,7 @@ module.exports = class NoticeController extends EventEmitter { this.noticePoller = null } - getState() { + getState () { var lastUnreadNotice = this.getLatestUnreadNotice() return { @@ -18,7 +18,7 @@ module.exports = class NoticeController extends EventEmitter { } } - getNoticesList() { + getNoticesList () { var data = this.configManager.getData() if ('noticesList' in data) { return data.noticesList @@ -27,28 +27,28 @@ module.exports = class NoticeController extends EventEmitter { } } - setNoticesList(list) { + setNoticesList (list) { var data = this.configManager.getData() data.noticesList = list this.configManager.setData(data) return Promise.resolve(true) } - markNoticeRead(notice, cb) { - cb = cb || function(err){ if (err) throw err } + markNoticeRead (notice, cb) { + cb = cb || function (err) { if (err) throw err } try { var notices = this.getNoticesList() var id = notice.id notices[id].read = true this.setNoticesList(notices) - let latestNotice = this.getLatestUnreadNotice() + const latestNotice = this.getLatestUnreadNotice() cb(null, latestNotice) } catch (err) { cb(err) } } - updateNoticesList() { + updateNoticesList () { return this._retrieveNoticeData().then((newNotices) => { var oldNotices = this.getNoticesList() var combinedNotices = this._mergeNotices(oldNotices, newNotices) @@ -56,7 +56,7 @@ module.exports = class NoticeController extends EventEmitter { }) } - getLatestUnreadNotice() { + getLatestUnreadNotice () { var notices = this.getNoticesList() var filteredNotices = notices.filter((notice) => { return notice.read === false @@ -73,7 +73,7 @@ module.exports = class NoticeController extends EventEmitter { }, 300000) } - _mergeNotices(oldNotices, newNotices) { + _mergeNotices (oldNotices, newNotices) { var noticeMap = this._mapNoticeIds(oldNotices) newNotices.forEach((notice) => { if (noticeMap.indexOf(notice.id) === -1) { @@ -83,11 +83,11 @@ module.exports = class NoticeController extends EventEmitter { return oldNotices } - _mapNoticeIds(notices) { + _mapNoticeIds (notices) { return notices.map((notice) => notice.id) } - _retrieveNoticeData() { + _retrieveNoticeData () { // Placeholder for the API. return Promise.resolve(hardCodedNotices) } |