From 0fb504e63ee267b864c4003c12668635e54b52ac Mon Sep 17 00:00:00 2001 From: moux1024 <403053463@qq.com> Date: Sun, 12 Oct 2025 00:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E6=B7=BB=E5=8A=A0check?= =?UTF-8?q?=E7=9A=84loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/pages/work-flow/download-options-modal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/pages/work-flow/download-options-modal.tsx b/components/pages/work-flow/download-options-modal.tsx index eafa603..e8a0316 100644 --- a/components/pages/work-flow/download-options-modal.tsx +++ b/components/pages/work-flow/download-options-modal.tsx @@ -31,6 +31,7 @@ function DownloadOptionsModal(props: DownloadOptionsModalProps) { const containerRef = useRef(null); const [withWatermark, setWithWatermark] = useState(true); const [baseAmount, setBaseAmount] = useState(0); + const [isCheckingBalance, setIsCheckingBalance] = useState(false); useEffect(() => { const originalOverflow = document.body.style.overflow; @@ -45,6 +46,7 @@ function DownloadOptionsModal(props: DownloadOptionsModalProps) { let aborted = false; const checkBalance = async () => { try { + if (!aborted) setIsCheckingBalance(true); const json: any = await post('/movie/download_video', { project_id: projectId, video_id: videoId, @@ -55,6 +57,8 @@ function DownloadOptionsModal(props: DownloadOptionsModalProps) { if (!aborted) setBaseAmount(Number.isFinite(amount) ? Number(amount) : 0); } catch { if (!aborted) setBaseAmount(0); + } finally { + if (!aborted) setIsCheckingBalance(false); } }; void checkBalance(); @@ -122,7 +126,8 @@ function DownloadOptionsModal(props: DownloadOptionsModalProps) {