year 1 hónapja
szülő
commit
ef81556a31
1 módosított fájl, 12 hozzáadás és 0 törlés
  1. 12 0
      src/app/[locale]/(TabBar)/deposit/page.tsx

+ 12 - 0
src/app/[locale]/(TabBar)/deposit/page.tsx

@@ -24,6 +24,7 @@ const Deposit = () => {
 
     React.useEffect(() => {
         getData();
+        // eslint-disable-next-line react-hooks/exhaustive-deps
     }, []);
 
     React.useEffect(() => {
@@ -31,6 +32,17 @@ const Deposit = () => {
         getInfo(id);
     }, [actIdx, shopTypeList]);
 
+    React.useEffect(() => {
+        if (!shopInfo || (shopInfo.id === 1 && shopInfo.num <= 0)) {
+            setShopTypeList((listValue) => {
+                return listValue.filter((item) => {
+                    return item.id !== 1;
+                });
+            });
+        }
+        // eslint-disable-next-line react-hooks/exhaustive-deps
+    }, [shopInfo]);
+
     const getData = async () => {
         const res = await getShopListApi();
         if (res?.code === 200 && res?.data) {