|
@@ -13,6 +13,7 @@ const Deposit = () => {
|
|
|
const [currentChannel, setCurrentChannel] = React.useState<any>({});
|
|
|
const [shopInfo, setShopInfo] = React.useState<ShopInfo | null>(null);
|
|
|
const [loading, setLoading] = React.useState(false);
|
|
|
+ const [isInit, setIsInit] = React.useState(true);
|
|
|
|
|
|
const actChange = (idx: number) => {
|
|
|
setActIdx(idx);
|
|
@@ -33,7 +34,7 @@ const Deposit = () => {
|
|
|
}, [actIdx, shopTypeList]);
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
- if (!shopInfo || (shopInfo.id === 1 && shopInfo.num <= 0)) {
|
|
|
+ if ((!shopInfo || (shopInfo.id === 1 && shopInfo.num <= 0)) && !isInit) {
|
|
|
setShopTypeList((listValue) => {
|
|
|
return listValue.filter((item) => {
|
|
|
return item.id !== 1;
|
|
@@ -74,6 +75,7 @@ const Deposit = () => {
|
|
|
};
|
|
|
|
|
|
const getInfo = async (id: number, isClear = true) => {
|
|
|
+ setIsInit(true);
|
|
|
if (!id) {
|
|
|
setShopInfo(null);
|
|
|
return;
|
|
@@ -88,6 +90,9 @@ const Deposit = () => {
|
|
|
res.data.products.sort((a: any, b: any) => {
|
|
|
return a.order - b.order;
|
|
|
});
|
|
|
+ if (res?.data.id === 1 && res?.data.num === 0) {
|
|
|
+ res.data.products = [];
|
|
|
+ }
|
|
|
setShopInfo(res?.data || {});
|
|
|
}
|
|
|
} catch {
|