aboutsummaryrefslogtreecommitdiff
path: root/src/routes/settings/+page.svelte
blob: f61b236bc90019f63b3dcc39d9a3a77da41e495b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<script lang="ts">
	/* eslint svelte/no-at-html-tags: "off" */

	import SettingHint from '$lib/Settings/SettingHint.svelte';
	import Attributions from '$lib/Settings/Attributions.svelte';
	import { env } from '$env/dynamic/public';
	import HeadTitle from '$lib/HeadTitle.svelte';
	import Display from '$lib/Settings/Categories/Display.svelte';
	import Calculation from '$lib/Settings/Categories/Calculation.svelte';
	import Debug from '$lib/Settings/Categories/Debug.svelte';
	import Cache from '$lib/Settings/Categories/Cache.svelte';
	import Category from '$lib/Settings/Category.svelte';

	export let data;

	// const pruneUnresolved = async () => {
	// 	const unresolved = await chapterDatabase.chapters.where('chapters').equals(-1).toArray();
	// 	const ids = unresolved.map((m) => m.id);

	// 	manga.set('');
	// 	anime.set('');
	// 	await chapterDatabase.chapters.bulkDelete(ids);
	// };
</script>

<HeadTitle route="Settings" path="/settings" />

<p>
	Have feedback or suggestions? Send a private message to
	<a href="https://anilist.co/user/fuwn" target="_blank">@fuwn</a> on AniList!
</p>

{#if data.user === undefined}
	Please log in to modify settings.
{:else}
	<Category title="RSS Feeds" id="feeds">
		<button
			on:click={() =>
				navigator.clipboard.writeText(
					`https://${
						env.PUBLIC_ANILIST_REDIRECT_URI?.includes('192.168') ? '192.168.1.60:5173' : 'due.moe'
					}/feeds/activity-notifications?token=${data.user.accessToken}&refresh=${
						data.user.refreshToken
					}`
				)}
		>
			Copy to clipboard
		</button>
		Your AniList notifications RSS feed URL
		<SettingHint lineBreak>Do not share this link with <b>anyone</b>!</SettingHint>
	</Category>
	<Category title="Display"><Display /></Category>
	<Category title="Calculation"><Calculation /></Category>
	<Category title="Cache"><Cache /></Category>
	<Category id="debug">
		<summary>Debug <small style="opacity: 50%;">{data.commit.slice(0, 7)}</small></summary>

		<Debug />
	</Category>
	<Category title="Attributions" open={false}><Attributions /></Category>
{/if}