aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-12-22 03:54:49 -0800
committerFuwn <[email protected]>2023-12-22 03:54:49 -0800
commit3e985f3154fdf510a01f23ee7c39e5f9b2730d66 (patch)
tree41b935fa0f96a1d828a825c45421028710121a92 /src/lib
parentfeat(wrapped): update full-year instructions (diff)
downloaddue.moe-3e985f3154fdf510a01f23ee7c39e5f9b2730d66.tar.xz
due.moe-3e985f3154fdf510a01f23ee7c39e5f9b2730d66.zip
feat(wrapped): refresh full year button
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Tools/Wrapped.svelte14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte
index 269e046a..57ec09b7 100644
--- a/src/lib/Tools/Wrapped.svelte
+++ b/src/lib/Tools/Wrapped.svelte
@@ -23,6 +23,7 @@
import { estimatedDayReading } from '$lib/Media/Manga/time';
import ActivityHistoryGrid from './ActivityHistoryGrid.svelte';
import SettingHint from '$lib/Settings/SettingHint.svelte';
+ import { database } from '$lib/Database/activities.js';
export let user: AniListAuthorisation;
@@ -339,6 +340,10 @@
return true;
});
};
+
+ const pruneFullYear = async () => {
+ await database.activities.bulkDelete((await database.activities.toArray()).map((m) => m.page));
+ };
</script>
{#if currentUserIdentity.id === -2}
@@ -503,13 +508,12 @@
Enable full-year activity<br />
<SettingHint>
If you have many activities, you may rate-limited and you may need multiple attempts
- to fully populate your local activity history database. If you get rate-limited, wait
- one minute, then try again.
+ to fully populate your local activity history database.<br />If you get rate-limited,
+ wait one minute, then try again.
+ <a href={'#'} on:click={pruneFullYear}>Refresh data</a>
</SettingHint><br />
+ <p />
{/if}
-
- <p />
-
<input type="checkbox" bind:checked={includeMusic} /> Include music<br />
<input type="checkbox" bind:checked={includeRepeats} /> Include rewatches & rereads<br />
<input type="checkbox" bind:checked={includeSpecials} /> Include specials and OVAs<br />