Fix for clearing current state only.
This commit is contained in:
parent
bf9b467bfe
commit
b426209efb
1 changed files with 8 additions and 3 deletions
|
|
@ -30,13 +30,18 @@ angular
|
||||||
|
|
||||||
function clear() {
|
function clear() {
|
||||||
console.log("sendFlow clear()");
|
console.log("sendFlow clear()");
|
||||||
|
clearCurrent();
|
||||||
|
service.previousStates = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearCurrent() {
|
||||||
|
console.log("sendFlow clearCurrent()");
|
||||||
service.amount = '';
|
service.amount = '';
|
||||||
service.fromWalletId = '';
|
service.fromWalletId = '';
|
||||||
service.sendMax = false;
|
service.sendMax = false;
|
||||||
service.thirdParty = null;
|
service.thirdParty = null;
|
||||||
service.toAddress = '';
|
service.toAddress = '';
|
||||||
service.toWalletId = '';
|
service.toWalletId = '';
|
||||||
service.previousStates = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -71,7 +76,7 @@ angular
|
||||||
console.log('sendFlow pop');
|
console.log('sendFlow pop');
|
||||||
if (service.previousStates.length) {
|
if (service.previousStates.length) {
|
||||||
var params = service.previousStates.pop();
|
var params = service.previousStates.pop();
|
||||||
clear();
|
clearCurrent();
|
||||||
map(params);
|
map(params);
|
||||||
} else {
|
} else {
|
||||||
clear();
|
clear();
|
||||||
|
|
@ -82,7 +87,7 @@ angular
|
||||||
console.log('sendFlow push');
|
console.log('sendFlow push');
|
||||||
var currentParams = getState();
|
var currentParams = getState();
|
||||||
service.previousStates.push(currentParams);
|
service.previousStates.push(currentParams);
|
||||||
clear();
|
clearCurrent();
|
||||||
map(params);
|
map(params);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue