aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <flyswatter@users.noreply.github.com>2016-12-22 04:04:05 +0800
committerGitHub <noreply@github.com>2016-12-22 04:04:05 +0800
commit73cdf0bfd49470bad1f0da4d0d894278c87af54e (patch)
treecf6d02769508e734336f388f6b2a1d7d5230e27f /app
parent674b2689826c770092a3dfee7fe76fb83c0b444a (diff)
parent91105474655a3e17eefbc3663928f6ca5bb6b71c (diff)
downloadtangerine-wallet-browser-73cdf0bfd49470bad1f0da4d0d894278c87af54e.tar
tangerine-wallet-browser-73cdf0bfd49470bad1f0da4d0d894278c87af54e.tar.gz
tangerine-wallet-browser-73cdf0bfd49470bad1f0da4d0d894278c87af54e.tar.bz2
tangerine-wallet-browser-73cdf0bfd49470bad1f0da4d0d894278c87af54e.tar.lz
tangerine-wallet-browser-73cdf0bfd49470bad1f0da4d0d894278c87af54e.tar.xz
tangerine-wallet-browser-73cdf0bfd49470bad1f0da4d0d894278c87af54e.tar.zst
tangerine-wallet-browser-73cdf0bfd49470bad1f0da4d0d894278c87af54e.zip
Merge pull request #944 from MetaMask/i938-uri-validation
I938 uri validation
Diffstat (limited to 'app')
-rw-r--r--app/scripts/notice-controller.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/app/scripts/notice-controller.js b/app/scripts/notice-controller.js
index 438f5c27e..00c87c670 100644
--- a/app/scripts/notice-controller.js
+++ b/app/scripts/notice-controller.js
@@ -9,7 +9,7 @@ module.exports = class NoticeController extends EventEmitter {
this.noticePoller = null
}
- getState() {
+ getState () {
var lastUnreadNotice = this.getLatestUnreadNotice()
return {
@@ -18,7 +18,7 @@ module.exports = class NoticeController extends EventEmitter {
}
}
- getNoticesList() {
+ getNoticesList () {
var data = this.configManager.getData()
if ('noticesList' in data) {
return data.noticesList
@@ -27,28 +27,28 @@ module.exports = class NoticeController extends EventEmitter {
}
}
- setNoticesList(list) {
+ setNoticesList (list) {
var data = this.configManager.getData()
data.noticesList = list
this.configManager.setData(data)
return Promise.resolve(true)
}
- markNoticeRead(notice, cb) {
- cb = cb || function(err){ if (err) throw err }
+ markNoticeRead (notice, cb) {
+ cb = cb || function (err) { if (err) throw err }
try {
var notices = this.getNoticesList()
var id = notice.id
notices[id].read = true
this.setNoticesList(notices)
- let latestNotice = this.getLatestUnreadNotice()
+ const latestNotice = this.getLatestUnreadNotice()
cb(null, latestNotice)
} catch (err) {
cb(err)
}
}
- updateNoticesList() {
+ updateNoticesList () {
return this._retrieveNoticeData().then((newNotices) => {
var oldNotices = this.getNoticesList()
var combinedNotices = this._mergeNotices(oldNotices, newNotices)
@@ -56,7 +56,7 @@ module.exports = class NoticeController extends EventEmitter {
})
}
- getLatestUnreadNotice() {
+ getLatestUnreadNotice () {
var notices = this.getNoticesList()
var filteredNotices = notices.filter((notice) => {
return notice.read === false
@@ -73,7 +73,7 @@ module.exports = class NoticeController extends EventEmitter {
}, 300000)
}
- _mergeNotices(oldNotices, newNotices) {
+ _mergeNotices (oldNotices, newNotices) {
var noticeMap = this._mapNoticeIds(oldNotices)
newNotices.forEach((notice) => {
if (noticeMap.indexOf(notice.id) === -1) {
@@ -83,11 +83,11 @@ module.exports = class NoticeController extends EventEmitter {
return oldNotices
}
- _mapNoticeIds(notices) {
+ _mapNoticeIds (notices) {
return notices.map((notice) => notice.id)
}
- _retrieveNoticeData() {
+ _retrieveNoticeData () {
// Placeholder for the API.
return Promise.resolve(hardCodedNotices)
}