aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/notice-controller.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2019-03-29 12:03:31 +0800
committerkumavis <aaron@kumavis.me>2019-03-29 12:03:31 +0800
commita64855ef4940f1a409b4a168a60d0f5f06836086 (patch)
tree1953d4de8cc4352e8122c971ee9a3f8337f4aab4 /app/scripts/notice-controller.js
parent781a39c039500fcfe8fce3c3d75081ff781c4cf1 (diff)
downloadtangerine-wallet-browser-a64855ef4940f1a409b4a168a60d0f5f06836086.tar
tangerine-wallet-browser-a64855ef4940f1a409b4a168a60d0f5f06836086.tar.gz
tangerine-wallet-browser-a64855ef4940f1a409b4a168a60d0f5f06836086.tar.bz2
tangerine-wallet-browser-a64855ef4940f1a409b4a168a60d0f5f06836086.tar.lz
tangerine-wallet-browser-a64855ef4940f1a409b4a168a60d0f5f06836086.tar.xz
tangerine-wallet-browser-a64855ef4940f1a409b4a168a60d0f5f06836086.tar.zst
tangerine-wallet-browser-a64855ef4940f1a409b4a168a60d0f5f06836086.zip
notices - markAllNoticesRead - use async/await
Diffstat (limited to 'app/scripts/notice-controller.js')
-rw-r--r--app/scripts/notice-controller.js23
1 files changed, 9 insertions, 14 deletions
diff --git a/app/scripts/notice-controller.js b/app/scripts/notice-controller.js
index d1a15ff08..050fca9c8 100644
--- a/app/scripts/notice-controller.js
+++ b/app/scripts/notice-controller.js
@@ -58,20 +58,15 @@ module.exports = class NoticeController extends EventEmitter {
}
}
- markAllNoticesRead (cb) {
- cb = cb || function (err) { if (err) throw err }
- try {
- const noticeList = this.getNoticesList()
- noticeList.forEach(notice => {
- notice.read = true
- notice.body = ''
- })
- this.setNoticesList(noticeList)
- const latestNotice = this.getNextUnreadNotice()
- cb(null, latestNotice)
- } catch (err) {
- cb(err)
- }
+ async markAllNoticesRead () {
+ const noticeList = this.getNoticesList()
+ noticeList.forEach(notice => {
+ notice.read = true
+ notice.body = ''
+ })
+ this.setNoticesList(noticeList)
+ const latestNotice = this.getNextUnreadNotice()
+ return latestNotice
}