|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
const EventEmitter = require('events').EventEmitter |
|
|
|
|
const {EventEmitter} = require('events') |
|
|
|
|
const semver = require('semver') |
|
|
|
|
const extend = require('xtend') |
|
|
|
|
const ObservableStore = require('obs-store') |
|
|
|
@ -46,8 +46,8 @@ module.exports = class NoticeController extends EventEmitter { |
|
|
|
|
markNoticeRead (noticeToMark, cb) { |
|
|
|
|
cb = cb || function (err) { if (err) throw err } |
|
|
|
|
try { |
|
|
|
|
var notices = this.getNoticesList() |
|
|
|
|
var index = notices.findIndex((currentNotice) => currentNotice.id === noticeToMark.id) |
|
|
|
|
const notices = this.getNoticesList() |
|
|
|
|
const index = notices.findIndex((currentNotice) => currentNotice.id === noticeToMark.id) |
|
|
|
|
notices[index].read = true |
|
|
|
|
notices[index].body = '' |
|
|
|
|
this.setNoticesList(notices) |
|
|
|
|