aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/notice-controller.js
diff options
context:
space:
mode:
authorThomas Huang <thomas.b.huang@gmail.com>2019-03-21 09:26:48 +0800
committerThomas Huang <thomas.b.huang@gmail.com>2019-03-21 09:26:48 +0800
commitc43374a553c28459be4cac116a72a4f34dddba72 (patch)
treee7584d60bf8617b742cdd09485f029e4d92f336d /app/scripts/notice-controller.js
parentfc534b8041bbf69f3f7f8384554934d68a081835 (diff)
downloadtangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.tar.gz
tangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.tar.zst
tangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.zip
Clear notices when setCompletedOnboarding is called
Diffstat (limited to 'app/scripts/notice-controller.js')
-rw-r--r--app/scripts/notice-controller.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/scripts/notice-controller.js b/app/scripts/notice-controller.js
index 6fe8b8cf0..d1a15ff08 100644
--- a/app/scripts/notice-controller.js
+++ b/app/scripts/notice-controller.js
@@ -58,6 +58,23 @@ 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 updateNoticesList () {
const newNotices = await this._retrieveNoticeData()
const oldNotices = this.getNoticesList()