From d139c6cd01701bbbc627b565460ef528cf49bbc1 Mon Sep 17 00:00:00 2001 From: Harshad Date: Thu, 19 Feb 2026 11:52:48 +0530 Subject: [PATCH] fix(result): hide download info for failed video generation --- frontend/assets/js/result2.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/assets/js/result2.js b/frontend/assets/js/result2.js index eece819..0b756a4 100644 --- a/frontend/assets/js/result2.js +++ b/frontend/assets/js/result2.js @@ -47,7 +47,11 @@ document.addEventListener('alpine:init', () => { if (audioIsDone) { console.log('Audio already exists. Fetching results...'); this.countdown = 0; - await this.pollResultStatus(); + this.timerEnded = true; + const resultIsDone = await this.pollResultStatus(); + if (!resultIsDone) { + this.startResultLoop(); + } } else { this.startTimer(); this.startSubmissionLoop(); @@ -196,6 +200,8 @@ document.addEventListener('alpine:init', () => { if (data.success === false || data.status === 'fail') { console.log('[Result API] Video generation failed.'); this.videoGenerationFailed = true; + this.countdown = 0; + this.timerEnded = true; return true; // Stop polling } @@ -381,11 +387,5 @@ document.addEventListener('alpine:init', () => { console.log('Not able to fetch pet name'); } }, - - get timerDisplay() { - const m = Math.floor(this.countdown / 60); - const s = this.countdown % 60; - return `${m.toString().padStart(2, '0')}:${s.toString().padStart(2, '0')}`; - } }); }); \ No newline at end of file