diff options
| author | Fuwn <[email protected]> | 2023-12-02 21:48:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-12-02 21:48:32 -0800 |
| commit | 99bbc3512e73cf65dcbb738d34c14fc6e0780a5c (patch) | |
| tree | 685925d59e819adf7df42da528a383e560d177af /src/lib/Tools | |
| parent | feat(wrapped): seperate rows to flexes (diff) | |
| download | due.moe-99bbc3512e73cf65dcbb738d34c14fc6e0780a5c.tar.xz due.moe-99bbc3512e73cf65dcbb738d34c14fc6e0780a5c.zip | |
fix(wrapped): better auto adjust
Diffstat (limited to 'src/lib/Tools')
| -rw-r--r-- | src/lib/Tools/Wrapped.svelte | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte index 3bfd0312..2ac5dfb2 100644 --- a/src/lib/Tools/Wrapped.svelte +++ b/src/lib/Tools/Wrapped.svelte @@ -37,7 +37,16 @@ includeSpecials = includeSpecials; includeRepeats = includeRepeats; - update().then(() => {}); + update() + .then(() => {}) + .catch(() => {}); + } + $: { + animeList = animeList; + mangaList = mangaList; + highestRatedCount = highestRatedCount; + + new Promise((resolve) => setTimeout(resolve, 1)).then(updateWidth); } const updateWidth = () => { @@ -163,14 +172,6 @@ for (const media of mangaList) { chapters += media.mediaListEntry?.progress || 0; } - - new MutationObserver((_mutations) => updateWidth()).observe( - document.querySelector('#wrapped')!, - { - childList: true, - subtree: true - } - ); }; /* eslint-disable @typescript-eslint/no-explicit-any */ |