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 () => {
if (this.isAuth && !this.subscriptionChecked) {
const checked = await this.transactionsService.check({ sortBy: 'transactionDate asc', rpp: 10 });
if (checked?.totalRecords) {
this.createModal('transaction-check', {
data: checked,
autoInit: false,
});
}
this.subscriptionChecked = true;
this.removeEventListener('routechanged', this.checkSubscriptions);
}