diff options
| author | Fuwn <[email protected]> | 2023-12-25 17:05:02 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-12-25 17:05:02 -0800 |
| commit | 75952ffda80af42ecaa786a9a85b401dbe539b96 (patch) | |
| tree | 03d801dbcc73b1151eb8a60da56f369f4fb3beb6 /src/lib/Tools | |
| parent | fix(wrapped): move panel length filter up (diff) | |
| download | due.moe-75952ffda80af42ecaa786a9a85b401dbe539b96.tar.xz due.moe-75952ffda80af42ecaa786a9a85b401dbe539b96.zip | |
fix(wrapped): null check all of genres tags
Diffstat (limited to 'src/lib/Tools')
| -rw-r--r-- | src/lib/Tools/Wrapped.svelte | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte index fe7545ba..9934aeb2 100644 --- a/src/lib/Tools/Wrapped.svelte +++ b/src/lib/Tools/Wrapped.svelte @@ -510,11 +510,11 @@ {/if} </div> {/if} - {#if topGenresTags} + {#if topMedia && topGenresTags && ((topMedia.topGenreMedia && topMedia.genres.length > 0) || (topMedia.topTagMedia && topMedia.tags.length > 0))} <div class="categories-grid" style="padding-top: 0;"> - <div class="category-grid pure-category category"> - <div class="grid-item image-grid"> - {#if topMedia} + {#if topMedia.topGenreMedia && topMedia.genres.length > 0} + <div class="category-grid pure-category category"> + <div class="grid-item image-grid"> <a href={`https://anilist.co/${topMedia.topGenreMedia.type.toLowerCase()}/${ topMedia.topGenreMedia.id @@ -543,14 +543,12 @@ {/each} </ol> </div> - {:else} - {@html nbsp('Loading top genres ...')} - {/if} + </div> </div> - </div> - <div class="category-grid pure-category category"> - <div class="grid-item image-grid"> - {#if topMedia} + {/if} + {#if topMedia.topTagMedia && topMedia.tags.length > 0} + <div class="category-grid pure-category category"> + <div class="grid-item image-grid"> <a href={`https://anilist.co/${topMedia.topTagMedia.type.toLowerCase()}/${ topMedia.topTagMedia.id @@ -579,11 +577,9 @@ {/each} </ol> </div> - {:else} - {@html nbsp('Loading top tags ...')} - {/if} + </div> </div> - </div> + {/if} </div> {/if} {#if !disableActivityHistory} |