aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJacky Chan <jchan@uber.com>2017-08-22 20:59:44 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-10-21 12:51:37 +0800
commitfd4fbdc0cd70e31764a497946f565757b204b616 (patch)
tree08e913920a475e3701255333b2d34524e6b3a939 /ui
parente1497fafa64b5f8e25407611709920dc5e0eaf77 (diff)
downloadtangerine-wallet-browser-fd4fbdc0cd70e31764a497946f565757b204b616.tar
tangerine-wallet-browser-fd4fbdc0cd70e31764a497946f565757b204b616.tar.gz
tangerine-wallet-browser-fd4fbdc0cd70e31764a497946f565757b204b616.tar.bz2
tangerine-wallet-browser-fd4fbdc0cd70e31764a497946f565757b204b616.tar.lz
tangerine-wallet-browser-fd4fbdc0cd70e31764a497946f565757b204b616.tar.xz
tangerine-wallet-browser-fd4fbdc0cd70e31764a497946f565757b204b616.tar.zst
tangerine-wallet-browser-fd4fbdc0cd70e31764a497946f565757b204b616.zip
Add NoticeScreen
Diffstat (limited to 'ui')
-rw-r--r--ui/app/actions.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 11cd14c16..f026fd0ab 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -696,21 +696,23 @@ function goBackToInitView () {
function markNoticeRead (notice) {
return (dispatch) => {
- dispatch(this.showLoadingIndication())
+ dispatch(actions.showLoadingIndication())
log.debug(`background.markNoticeRead`)
- background.markNoticeRead(notice, (err, notice) => {
- dispatch(this.hideLoadingIndication())
- if (err) {
- return dispatch(actions.displayWarning(err))
- }
- if (notice) {
- return dispatch(actions.showNotice(notice))
- } else {
- dispatch(this.clearNotices())
- return {
- type: actions.SHOW_ACCOUNTS_PAGE,
+ return new Promise((resolve, reject) => {
+ background.markNoticeRead(notice, (err, notice) => {
+ dispatch(actions.hideLoadingIndication())
+ if (err) {
+ dispatch(actions.displayWarning(err))
+ return reject(err)
}
- }
+ if (notice) {
+ dispatch(actions.showNotice(notice))
+ resolve()
+ } else {
+ dispatch(actions.clearNotices())
+ resolve()
+ }
+ })
})
}
}