From d2554bedf3984ba4eb3a52b5649daa9c7c686c39 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 7 Dec 2022 15:44:16 -0300
Subject: no-fix: remove 'any' and login status is taken from backend

---
 packages/demobank-ui/src/pages/home/Transactions.tsx | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to 'packages/demobank-ui/src/pages/home/Transactions.tsx')

diff --git a/packages/demobank-ui/src/pages/home/Transactions.tsx b/packages/demobank-ui/src/pages/home/Transactions.tsx
index eb344403f..c0bb86024 100644
--- a/packages/demobank-ui/src/pages/home/Transactions.tsx
+++ b/packages/demobank-ui/src/pages/home/Transactions.tsx
@@ -10,14 +10,20 @@ export function Transactions({
   pageNumber,
   accountLabel,
   balanceValue,
-}: any): VNode {
+}: {
+  pageNumber: number;
+  accountLabel: string;
+  balanceValue?: string;
+}): VNode {
   const { i18n } = useTranslationContext();
   const { data, error, mutate } = useSWR(
     `access-api/accounts/${accountLabel}/transactions?page=${pageNumber}`,
   );
   useEffect(() => {
-    mutate();
-  }, [balanceValue]);
+    if (balanceValue) {
+      mutate();
+    }
+  }, [balanceValue ?? ""]);
   if (typeof error !== "undefined") {
     console.log("transactions not found error", error);
     switch (error.status) {
-- 
cgit v1.2.3

