diff options
author | Thomas Huang <thomas.b.huang@gmail.com> | 2019-03-21 09:26:48 +0800 |
---|---|---|
committer | Thomas Huang <thomas.b.huang@gmail.com> | 2019-03-21 09:26:48 +0800 |
commit | c43374a553c28459be4cac116a72a4f34dddba72 (patch) | |
tree | e7584d60bf8617b742cdd09485f029e4d92f336d /ui/app | |
parent | fc534b8041bbf69f3f7f8384554934d68a081835 (diff) | |
download | tangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.tar tangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.tar.gz tangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.tar.bz2 tangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.tar.lz tangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.tar.xz tangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.tar.zst tangerine-wallet-browser-c43374a553c28459be4cac116a72a4f34dddba72.zip |
Clear notices when setCompletedOnboarding is called
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/actions.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index d8363eba6..65070fc8c 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -2487,16 +2487,29 @@ function setCompletedOnboarding () { return dispatch => { dispatch(actions.showLoadingIndication()) return new Promise((resolve, reject) => { - background.completeOnboarding(err => { - dispatch(actions.hideLoadingIndication()) + background.markAllNoticesRead(err => { if (err) { dispatch(actions.displayWarning(err.message)) return reject(err) } - dispatch(actions.completeOnboarding()) - resolve() + dispatch(actions.clearNotices()) + resolve(false) + }) + }) + .then(() => { + return new Promise((resolve, reject) => { + background.completeOnboarding(err => { + if (err) { + dispatch(actions.displayWarning(err.message)) + return reject(err) + } + + dispatch(actions.completeOnboarding()) + dispatch(actions.hideLoadingIndication()) + resolve() + }) }) }) } |