diff options
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index c4212f35b..f3e9d2b27 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -317,6 +317,11 @@ var actions = { UPDATE_PREFERENCES: 'UPDATE_PREFERENCES', setUseNativeCurrencyAsPrimaryCurrencyPreference, + // Migration of users to new UI + setCompletedUiMigration, + completeUiMigration, + COMPLETE_UI_MIGRATION: 'COMPLETE_UI_MIGRATION', + // Onboarding setCompletedOnboarding, completeOnboarding, @@ -2474,6 +2479,31 @@ function completeOnboarding () { } } +function setCompletedUiMigration () { + return dispatch => { + dispatch(actions.showLoadingIndication()) + return new Promise((resolve, reject) => { + background.completeUiMigration(err => { + dispatch(actions.hideLoadingIndication()) + + if (err) { + dispatch(actions.displayWarning(err.message)) + return reject(err) + } + + dispatch(actions.completeUiMigration()) + resolve() + }) + }) + } +} + +function completeUiMigration () { + return { + type: actions.COMPLETE_UI_MIGRATION, + } +} + function setNetworkNonce (networkNonce) { return { type: actions.SET_NETWORK_NONCE, |