fix(result): hide download info for failed video generation

This commit is contained in:
Harshad 2026-02-19 11:52:48 +05:30
parent 1e6462132d
commit d139c6cd01

View file

@ -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')}`;
}
});
});