aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Tools
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-02 21:48:32 -0800
committerFuwn <[email protected]>2023-12-02 21:48:32 -0800
commit99bbc3512e73cf65dcbb738d34c14fc6e0780a5c (patch)
tree685925d59e819adf7df42da528a383e560d177af /src/lib/Tools
parentfeat(wrapped): seperate rows to flexes (diff)
downloaddue.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.svelte19
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 */