Fix: When adding lock information. After the initial entry, the voucher and account types list were useless.

This commit is contained in:
Amritanshu Agrawal 2023-09-03 10:09:37 +05:30
parent dbc0b85a44
commit 7aeee662c0
1 changed files with 6 additions and 2 deletions

View File

@ -104,13 +104,13 @@ export class SettingsComponent implements OnInit {
};
this.accountTypes = data.accountTypes;
this.voucherTypes = data.voucherTypes;
this.initLockAccountVoucherTypes();
this.showLockInformation(data.lockInformation);
this.maintenance = data.maintenance;
});
}
showLockInformation(info: LockInfo[]) {
this.lockInformation = info;
initLockAccountVoucherTypes() {
this.lockInfoForm.controls.accountTypes.clear();
this.accountTypes.forEach(() =>
this.lockInfoForm.controls.accountTypes.push(
@ -127,6 +127,10 @@ export class SettingsComponent implements OnInit {
}),
),
);
}
showLockInformation(info: LockInfo[]) {
this.lockInformation = info;
this.dataSource = new LockDataSource(this.lockObservable);
this.lockObservable.next(this.lockInformation);
}