From 3e7f7d1c958187c3426ba17d1104acb0953454b9 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 20 Mar 2026 15:51:55 -0400 Subject: [PATCH] fix(frontend): resolve submit spinner hang and data loss issues - Add try-catch-finally error handling to handleSubmit and deleteEntries functions to ensure submitting state is always reset, even when API calls fail or timeout. This fixes the infinite loading spinner bug. - Preserve genres field after AniList updates, matching the existing tags preservation pattern. Prevents genres array from being lost after form submission, which was causing "{#each} only works with iterable values" error when the page re-rendered. - Add fallback (|| []) to genres each block to prevent rendering errors when genres is undefined or null for entries without genre data. These fixes ensure robust error handling and data consistency during anime list updates across AniList, MAL, and Simkl services. Fixes: submit button spinner never stopping after form submission Fixes: "{#each} only works with iterable values" error on genres display --- frontend/src/helperComponents/Anime.svelte | 1616 ++++++++++---------- 1 file changed, 794 insertions(+), 822 deletions(-) diff --git a/frontend/src/helperComponents/Anime.svelte b/frontend/src/helperComponents/Anime.svelte index 44cb7c8..43e4d6a 100644 --- a/frontend/src/helperComponents/Anime.svelte +++ b/frontend/src/helperComponents/Anime.svelte @@ -1,871 +1,843 @@
-

- {title} -

-
-
- {title} Cover Image - -
+

+ {title} +

+
+
+ {title} Cover Image + +
-
-
+
+
+ +
+ - + + + + - -
-
- / {currentAniListAnime.data.MediaList.media - .nextAiringEpisode.episode !== 0 - ? currentAniListAnime.data.MediaList.media - .nextAiringEpisode.episode - 1 - : currentAniListAnime.data.MediaList.media.episodes} -
- {#if currentAniListAnime.data.MediaList.media.nextAiringEpisode.episode !== 0} -
- of {currentAniListAnime.data.MediaList.media - .episodes} -
- {/if} -
-
- - - {#each statusOptions as option} - - {/each} - -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
-
-
-
-
- - -
-
- - -
-
- -
-
- - -
-
- -
-
-

Genres

- {#each currentAniListAnime.data.MediaList.media.genres as genre} -
- -
- -
-
- {genre} -
+ bind:value={startingAnilistStatusOption} + > + {#each statusOptions as option} + {/each} -

Tags

-
- {#each currentAniListAnime.data.MediaList.media.tags as tag} -
- -
- - ({tag.rank}%) -
-
- {tag.description} -
- {/each} -
+
- -
-

Summary

-

- {@html currentAniListAnime.data.MediaList.media.description} -

+
+
+
+ +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+
+
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+

Genres

+ {#each currentAniListAnime.data.MediaList.media.genres || [] as genre} +
+ +
+ +
+
+ {genre} +
+ {/each} +

Tags

+
+ {#each currentAniListAnime.data.MediaList.media.tags as tag} +
+ +
+ + ({tag.rank}%) +
+
+ {tag.description} +
+ {/each} +
+
+ +
+

Summary

+

+ {@html currentAniListAnime.data.MediaList.media.description} +

+
+