From 9bfce458ff87f28a034b6db069aa5a60766bdac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Jurmanovi=C4=87?= Date: Sun, 12 Dec 2021 19:32:00 +0100 Subject: [PATCH] open modal if any records --- src/components/app-main/AppMainElement.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/app-main/AppMainElement.ts b/src/components/app-main/AppMainElement.ts index 64b19d0..4f09b2d 100644 --- a/src/components/app-main/AppMainElement.ts +++ b/src/components/app-main/AppMainElement.ts @@ -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 }); - this.createModal('transaction-check', { - data: checked, - autoInit: false, - }); + if (checked?.totalRecords) { + this.createModal('transaction-check', { + data: checked, + autoInit: false, + }); + } this.subscriptionChecked = true; this.removeEventListener('routechanged', this.checkSubscriptions); }