diff --git a/src/components/DashboardS2/DailyRoulette/DailyDrawModal.tsx b/src/components/DashboardS2/DailyRoulette/DailyDrawModal.tsx index 40a445d1..6b3c6c33 100644 --- a/src/components/DashboardS2/DailyRoulette/DailyDrawModal.tsx +++ b/src/components/DashboardS2/DailyRoulette/DailyDrawModal.tsx @@ -98,11 +98,14 @@ const DailyDrawModal: React.FC = (props: IProps) => { ); return; } - //TODO call api + if (!modalInstance.isOpen) { + modalInstance.onOpen(); + } const res = await dailyOpen(); const tokenId = res.result.tokenId as number; const prizeId = PRIZE_MAP[tokenId]; setSpinging(true); + onDrawed(); // update remain times await drawRef.current?.start(prizeId); const prize = PrizeItems[PRIZE_MAP[tokenId]]; setMintResult({ @@ -125,6 +128,7 @@ const DailyDrawModal: React.FC = (props: IProps) => { await sendTrademarkMintTx(mintParams); setMintStatus(MintStatus.Success); mintResultModal.onOpen(); + onDrawed(); // update remain times after mint tx } catch (e) { console.log(e); setMintStatus(MintStatus.Failed); @@ -144,8 +148,8 @@ const DailyDrawModal: React.FC = (props: IProps) => { mintResultModal.onOpen(); setSpinging(false); } - onDrawed(); - if (remain === 1) { + + if (!remain || remain <= 1) { modalInstance.onClose(); } }, [ @@ -215,7 +219,7 @@ const DailyDrawModal: React.FC = (props: IProps) => { { - if (signature) { + if (signature && !apiToken) { getJWT(); } }, [signature, apiToken]); diff --git a/vite.config.ts b/vite.config.ts index 80419bc0..9bc30499 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -47,8 +47,8 @@ export default defineConfig({ port: 3001, proxy: { "/app-api": { - // target: "https://goerli.app.zklink.io", - target: "https://app-api.zklink.io", + target: "https://goerli.app.zklink.io", + // target: "https://app-api.zklink.io", changeOrigin: true, rewrite: (path) => path.replace(/^\/app-api/, ""), },