From d735439de9f4f0bcbaab59afa7dab51e24788289 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Tue, 12 Feb 2019 10:33:37 -0330 Subject: Update NoticesController to use ES6 destructuring, const, let --- app/scripts/notice-controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/scripts') diff --git a/app/scripts/notice-controller.js b/app/scripts/notice-controller.js index ce686d9d1..6fe8b8cf0 100644 --- a/app/scripts/notice-controller.js +++ b/app/scripts/notice-controller.js @@ -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) -- cgit v1.2.3