aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-12-20 05:35:43 +0800
committerDan Finlay <dan@danfinlay.com>2016-12-20 05:37:27 +0800
commit77d2deb17654b87dfd306b7f7cef335b1b511a8f (patch)
tree7476af4926a4e27999086ee570e46c4f74621b84 /ui/app/actions.js
parent1b6ee56cac34cd3544fd375cad342eb8240ae8aa (diff)
parent6ce0bc4b11ccb7ffae4f58980db0301dc418c9c0 (diff)
downloadtangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.gz
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.bz2
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.lz
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.xz
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.tar.zst
tangerine-wallet-browser-77d2deb17654b87dfd306b7f7cef335b1b511a8f.zip
Merged master into dev
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 41be1004c..58600dd34 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -13,6 +13,13 @@ var actions = {
// remote state
UPDATE_METAMASK_STATE: 'UPDATE_METAMASK_STATE',
updateMetamaskState: updateMetamaskState,
+ // notices
+ MARK_NOTICE_READ: 'MARK_NOTICE_READ',
+ markNoticeRead: markNoticeRead,
+ SHOW_NOTICE: 'SHOW_NOTICE',
+ showNotice: showNotice,
+ CLEAR_NOTICES: 'CLEAR_NOTICES',
+ clearNotices: clearNotices,
// intialize screen
AGREE_TO_DISCLAIMER: 'AGREE_TO_DISCLAIMER',
agreeToDisclaimer: agreeToDisclaimer,
@@ -540,6 +547,43 @@ function goBackToInitView () {
}
//
+// notice
+//
+
+function markNoticeRead (notice) {
+ return (dispatch) => {
+ dispatch(this.showLoadingIndication())
+ background.markNoticeRead(notice, (err, notice) => {
+ dispatch(this.hideLoadingIndication())
+ if (err) {
+ return dispatch(actions.showWarning(err))
+ }
+ if (notice) {
+ return dispatch(actions.showNotice(notice))
+ } else {
+ dispatch(this.clearNotices())
+ return {
+ type: actions.SHOW_ACCOUNTS_PAGE,
+ }
+ }
+ })
+ }
+}
+
+function showNotice (notice) {
+ return {
+ type: actions.SHOW_NOTICE,
+ value: notice,
+ }
+}
+
+function clearNotices () {
+ return {
+ type: actions.CLEAR_NOTICES,
+ }
+}
+
+//
// config
//