mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Update NoticesController to use ES6 destructuring, const, let
This commit is contained in:
parent
ae084cef6c
commit
d735439de9
@ -1,4 +1,4 @@
|
|||||||
const EventEmitter = require('events').EventEmitter
|
const {EventEmitter} = require('events')
|
||||||
const semver = require('semver')
|
const semver = require('semver')
|
||||||
const extend = require('xtend')
|
const extend = require('xtend')
|
||||||
const ObservableStore = require('obs-store')
|
const ObservableStore = require('obs-store')
|
||||||
@ -46,8 +46,8 @@ module.exports = class NoticeController extends EventEmitter {
|
|||||||
markNoticeRead (noticeToMark, cb) {
|
markNoticeRead (noticeToMark, cb) {
|
||||||
cb = cb || function (err) { if (err) throw err }
|
cb = cb || function (err) { if (err) throw err }
|
||||||
try {
|
try {
|
||||||
var notices = this.getNoticesList()
|
const notices = this.getNoticesList()
|
||||||
var index = notices.findIndex((currentNotice) => currentNotice.id === noticeToMark.id)
|
const index = notices.findIndex((currentNotice) => currentNotice.id === noticeToMark.id)
|
||||||
notices[index].read = true
|
notices[index].read = true
|
||||||
notices[index].body = ''
|
notices[index].body = ''
|
||||||
this.setNoticesList(notices)
|
this.setNoticesList(notices)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user