aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/notice-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/notice-controller.js')
-rw-r--r--app/scripts/notice-controller.js6
1 files changed, 3 insertions, 3 deletions
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)