trigger errorState on submission & result API failure

This commit is contained in:
Harshad 2026-02-06 11:13:07 +05:30
parent 9a97120464
commit e922b4d016

View file

@ -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;
}
},