diff options
author | kumavis <kumavis@users.noreply.github.com> | 2019-03-29 14:23:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-29 14:23:02 +0800 |
commit | c3a605f27a846b72227237cefa6e4590c8a3b2c1 (patch) | |
tree | 6dfc14e35e25ae47b04a331d8d8ccb0bc4341c64 /ui | |
parent | 133ed80aeeeea4e2b0e9f1acb532f5d66f2575ca (diff) | |
parent | ed381f5b2a3a85d351248769b3d150742acb703b (diff) | |
download | tangerine-wallet-browser-c3a605f27a846b72227237cefa6e4590c8a3b2c1.tar tangerine-wallet-browser-c3a605f27a846b72227237cefa6e4590c8a3b2c1.tar.gz tangerine-wallet-browser-c3a605f27a846b72227237cefa6e4590c8a3b2c1.tar.bz2 tangerine-wallet-browser-c3a605f27a846b72227237cefa6e4590c8a3b2c1.tar.lz tangerine-wallet-browser-c3a605f27a846b72227237cefa6e4590c8a3b2c1.tar.xz tangerine-wallet-browser-c3a605f27a846b72227237cefa6e4590c8a3b2c1.tar.zst tangerine-wallet-browser-c3a605f27a846b72227237cefa6e4590c8a3b2c1.zip |
Merge pull request #6328 from MetaMask/clearNotices
Clear notices
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/store/actions.js | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index b2aa28c93..e5825b5f6 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -2488,21 +2488,27 @@ function setShowFiatConversionOnTestnetsPreference (value) { } function setCompletedOnboarding () { - return dispatch => { + return async dispatch => { dispatch(actions.showLoadingIndication()) - return new Promise((resolve, reject) => { - background.completeOnboarding(err => { - dispatch(actions.hideLoadingIndication()) - if (err) { - dispatch(actions.displayWarning(err.message)) - return reject(err) - } + try { + await pify(background.markAllNoticesRead).call(background) + } catch (err) { + dispatch(actions.displayWarning(err.message)) + throw err + } - dispatch(actions.completeOnboarding()) - resolve() - }) - }) + dispatch(actions.clearNotices()) + + try { + await pify(background.completeOnboarding).call(background) + } catch (err) { + dispatch(actions.displayWarning(err.message)) + throw err + } + + dispatch(actions.completeOnboarding()) + dispatch(actions.hideLoadingIndication()) } } |