Skip to content
Snippets Groups Projects
Commit c5fd558c authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Settings: when disabling expert mode: should logout when wallet stopped,...

[fix] Settings: when disabling expert mode: should logout when wallet stopped, to be able to relogin
parent 820890a9
No related branches found
No related tags found
No related merge requests found
Pipeline #31745 failed
......@@ -46,20 +46,18 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'ngSanitize',
// removeIf(android)
// removeIf(ios)
// removeIf(firefoxos)
// -- Automatic redirection to large state (if define) (keep this code for platforms web and ubuntu build)
if (next.data.large && !UIUtils.screen.isSmall()) {
event.preventDefault();
$state.go(next.data.large, nextParams);
return;
}
// endRemoveIf(firefoxos)
// endRemoveIf(ios)
// endRemoveIf(android)
var wallet = nextParams.wallet && nextParams.wallet != "default" ? csWallet.children.get(nextParams.wallet) : csWallet;
var wallet = nextParams.wallet && nextParams.wallet !== 'default' ? csWallet.children.get(nextParams.wallet) : csWallet;
if (nextParams.wallet && !wallet) {
console.warn("[app] Unable to find the children wallet: " + nextParams.wallet);
console.warn('[app] Unable to find the children wallet: ' + nextParams.wallet);
}
var goNextState = function() {
preventStateChange = false;
......@@ -94,7 +92,7 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'ngSanitize',
event.preventDefault();
options = next.data.minData ? {minData: true} : undefined;
preventStateChange = true;
console.debug("[app] State need login...");
console.debug('[app] State need login...');
return csWallet.login(options)
.then(goNextState)
.catch(processError);
......@@ -108,7 +106,7 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'ngSanitize',
// Show loading message, when full load
if (!options || !options.minData) UIUtils.loading.show();
console.debug("[app] State load wallet data...");
console.debug('[app] State load wallet data...');
return wallet.loadData(options)
.then(goNextState)
.catch(processError);
......
......@@ -2362,9 +2362,15 @@ angular.module('cesium.wallet.services', ['ngApi', 'ngFileSaver', 'cesium.bma.se
}
function stop() {
var wasLogin = isLogin();
var wasAuth = isAuth();
console.debug('[wallet] Stopping...');
removeListeners();
resetData();
// Send logout/unauth events
if (wasLogin) api.data.raise.logout();
if (wasAuth) api.data.raise.unauth();
}
function restart() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment