feat: add error handling to player episode functions

This commit is contained in:
2026-06-16 14:00:35 +02:00
committed by Milas Holsting
parent 0cd47ab0fe
commit 3a1a2129d9
3 changed files with 9 additions and 4 deletions

View File

@@ -29,8 +29,9 @@ export const completeAnime = async (episodeNumber: number): Promise<void> => {
caret.textContent = "▾";
trigger.appendChild(caret);
}
} catch {
} catch (error) {
state.episode.completionSent = false;
console.error("failed to complete anime:", error);
if (state.episode.completionAttempts < 2) {
state.episode.completionAttempts++;
setTimeout(() => completeAnime(episodeNumber), 1000);