From 1d0fcf129c8bd7174aecccca3acf54ee83215d19 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 9 Feb 2017 17:47:51 -0800 Subject: Fix bugs with notice. Add disclaimer notice. --- app/scripts/notice-controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/scripts/notice-controller.js') diff --git a/app/scripts/notice-controller.js b/app/scripts/notice-controller.js index ba7c68df4..0d72760fe 100644 --- a/app/scripts/notice-controller.js +++ b/app/scripts/notice-controller.js @@ -35,12 +35,12 @@ module.exports = class NoticeController extends EventEmitter { return Promise.resolve(true) } - markNoticeRead (notice, cb) { + markNoticeRead (noticeToMark, cb) { cb = cb || function (err) { if (err) throw err } try { var notices = this.getNoticesList() - var id = notice.id - notices[id].read = true + var index = notices.findIndex((currentNotice) => currentNotice.id === noticeToMark.id) + notices[index].read = true this.setNoticesList(notices) const latestNotice = this.getLatestUnreadNotice() cb(null, latestNotice) -- cgit v1.2.3