open modal if any records

This commit is contained in:
Fran Jurmanović
2021-12-12 19:32:00 +01:00
parent 9197018df2
commit 9bfce458ff

View File

@@ -130,10 +130,12 @@ class AppMainElement extends HTMLElement {
checkSubscriptions = async () => { checkSubscriptions = async () => {
if (this.isAuth && !this.subscriptionChecked) { if (this.isAuth && !this.subscriptionChecked) {
const checked = await this.transactionsService.check({ sortBy: 'transactionDate asc', rpp: 10 }); const checked = await this.transactionsService.check({ sortBy: 'transactionDate asc', rpp: 10 });
this.createModal('transaction-check', { if (checked?.totalRecords) {
data: checked, this.createModal('transaction-check', {
autoInit: false, data: checked,
}); autoInit: false,
});
}
this.subscriptionChecked = true; this.subscriptionChecked = true;
this.removeEventListener('routechanged', this.checkSubscriptions); this.removeEventListener('routechanged', this.checkSubscriptions);
} }