Fix account change handling in balance chart component.
This commit is contained in:
parent
5960e9ee77
commit
4861f5ce49
@ -156,24 +156,21 @@ module.exports = angular.module('balanceChartModule', [
|
||||
{ value: 0, axis: 'y', class: 'zeroline'},
|
||||
]);
|
||||
|
||||
vm.chart.ygrids.add({
|
||||
value: account.authorized_overdraft,
|
||||
axis: 'y',
|
||||
class: 'overdraft'
|
||||
});
|
||||
if(account) {
|
||||
vm.chart.ygrids.add({
|
||||
value: account.authorized_overdraft,
|
||||
axis: 'y',
|
||||
class: 'overdraft'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
vm.$onChanges = function(changes) {
|
||||
if('account' in changes) {
|
||||
if('$promise' in vm.account && vm.account.$resolved === false) {
|
||||
vm.account.$promise.then(function(account) {
|
||||
vm.setLines(account);
|
||||
return account;
|
||||
});
|
||||
} else {
|
||||
vm.setLines(vm.account);
|
||||
}
|
||||
vm.setLines(changes.account.currentValue);
|
||||
} else {
|
||||
vm.setLines(vm.account);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user