From 8ce4dd8771c3a438f333315ae7c99c5de6f51aec Mon Sep 17 00:00:00 2001 From: "Ali.Hosseini" Date: Wed, 8 Jul 2026 16:56:36 +0330 Subject: [PATCH] fix(frontend): handle Casino load failure gracefully When investCheck() threw (e.g. production API error), Casino.vue rendered a blank modal because there was no fallback branch after the loading and checkResult conditions. Add a loadError state with a friendly message and a retry button so the stock market modal never opens empty. Co-Authored-By: Claude Opus 4.8 --- .../src/components/features/player/Casino.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/src/components/features/player/Casino.vue b/frontend/src/components/features/player/Casino.vue index 761d526..7f2a843 100644 --- a/frontend/src/components/features/player/Casino.vue +++ b/frontend/src/components/features/player/Casino.vue @@ -34,6 +34,19 @@ در حال بارگذاری اطلاعات بورس... +
+

+ بورس در دسترس نیست +

+

+ در حال حاضر امکان اتصال به بورس وجود ندارد. لطفاً بعداً + دوباره تلاش کنید. +

+ +
+
زمان باقی‌مانده: {{ countdown }} @@ -138,6 +151,7 @@ const emit = defineEmits(['close']); const isLoading = ref(true); const isInvesting = ref(false); const checkResult = ref(null); +const loadError = ref(false); const investAmount = ref(0); const toast = useToast(); const countdown = ref(''); @@ -194,10 +208,12 @@ watch( async function doInvestCheck() { isLoading.value = true; + loadError.value = false; try { const result = await investCheck(); checkResult.value = result; } catch (error) { + loadError.value = true; toast.error(error.message || 'خطا در دریافت اطلاعات بورس'); logger.error('Error calling investCheck:', error); } finally {