Fix account change handling in balance chart component.
This commit is contained in:
parent
5960e9ee77
commit
4861f5ce49
@ -156,25 +156,22 @@ module.exports = angular.module('balanceChartModule', [
|
||||
{ value: 0, axis: 'y', class: 'zeroline'},
|
||||
]);
|
||||
|
||||
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;
|
||||
});
|
||||
vm.setLines(changes.account.currentValue);
|
||||
} else {
|
||||
vm.setLines(vm.account);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user