trigger errorState on submission & result API failure
This commit is contained in:
parent
9a97120464
commit
e922b4d016
1 changed files with 9 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ document.addEventListener('alpine:init', () => {
|
|||
const poll = setInterval(async () => {
|
||||
const isDone = await this.pollStatus();
|
||||
if (isDone) clearInterval(poll);
|
||||
}, 10000);
|
||||
}, (10*1000));
|
||||
},
|
||||
|
||||
async pollSubmissionStatus() {
|
||||
|
|
@ -122,6 +122,10 @@ document.addEventListener('alpine:init', () => {
|
|||
|
||||
} catch (e) {
|
||||
console.error('[Submission API] Error:', e);
|
||||
this.showError(
|
||||
'Oops! Something went wrong',
|
||||
'We couldn\'t generate your pet love song. Please try again.'
|
||||
);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
|
@ -160,6 +164,10 @@ document.addEventListener('alpine:init', () => {
|
|||
return false;
|
||||
} catch (e) {
|
||||
console.error('[Result API] Error:', e);
|
||||
this.showError(
|
||||
'Oops! Something went wrong',
|
||||
'We couldn\'t generate your pet love song. Please try again.'
|
||||
);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue