fix(result): hide download info for failed video generation
This commit is contained in:
parent
1e6462132d
commit
d139c6cd01
1 changed files with 7 additions and 7 deletions
|
|
@ -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')}`;
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue