Handle episode navigation async errors

This commit is contained in:
2026-06-20 18:29:55 +02:00
committed by Milas Holsting
parent a00d854062
commit 3430541aef

View File

@@ -32,7 +32,9 @@ export const goToNextEpisode = async (): Promise<void> => {
// final episode: trigger completion flow or just stop if airing // final episode: trigger completion flow or just stop if airing
if (state.episode.total > 0 && currentEp >= state.episode.total) { if (state.episode.total > 0 && currentEp >= state.episode.total) {
if (!state.episode.isAiring) { if (!state.episode.isAiring) {
void completeAnime(currentEp); completeAnime(currentEp).catch((error) => {
console.error("failed to complete final episode:", error);
});
} }
showEndState(); showEndState();
return; return;
@@ -108,7 +110,9 @@ export const goToNextEpisode = async (): Promise<void> => {
updateQualityOptions(); updateQualityOptions();
updateModeButtons(); updateModeButtons();
updateOverlay(state.episode.current, data.episode_title ?? ""); updateOverlay(state.episode.current, data.episode_title ?? "");
void hydrateAlternateMode(); hydrateAlternateMode().catch((error) => {
console.error("failed to hydrate alternate mode after episode change:", error);
});
// update skip segments // update skip segments
if (data.segments?.length) { if (data.segments?.length) {