diff options
| author | Fuwn <[email protected]> | 2026-04-02 09:56:45 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-02 09:56:45 +0000 |
| commit | aa2af2e5b534c81e18e6bb6f735104fc32d5d830 (patch) | |
| tree | 1745a437e584ab658dc31fa3f74070f961033a13 /src | |
| parent | fix(ui): tune april fools notification copy (diff) | |
| download | due.moe-aa2af2e5b534c81e18e6bb6f735104fc32d5d830.tar.xz due.moe-aa2af2e5b534c81e18e6bb6f735104fc32d5d830.zip | |
revert(ui): remove april fools executive mode
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/List/Anime/CleanAnimeList.svelte | 13 | ||||
| -rw-r--r-- | src/lib/List/Anime/DueAnimeList.svelte | 10 | ||||
| -rw-r--r-- | src/lib/List/Anime/UpcomingAnimeList.svelte | 6 | ||||
| -rw-r--r-- | src/lib/List/ListTitle.svelte | 6 | ||||
| -rw-r--r-- | src/lib/List/Manga/CleanMangaList.svelte | 25 | ||||
| -rw-r--r-- | src/lib/List/Manga/MangaListTemplate.svelte | 33 | ||||
| -rw-r--r-- | src/lib/Utility/executiveMode.ts | 51 | ||||
| -rw-r--r-- | src/routes/+layout.svelte | 97 | ||||
| -rw-r--r-- | src/routes/+page.svelte | 14 | ||||
| -rw-r--r-- | src/routes/completed/+page.svelte | 10 | ||||
| -rw-r--r-- | src/stores/aprilFools.ts | 37 |
11 files changed, 52 insertions, 250 deletions
diff --git a/src/lib/List/Anime/CleanAnimeList.svelte b/src/lib/List/Anime/CleanAnimeList.svelte index 93c8f208..808a8e5b 100644 --- a/src/lib/List/Anime/CleanAnimeList.svelte +++ b/src/lib/List/Anime/CleanAnimeList.svelte @@ -19,8 +19,6 @@ import stateBin from "$stores/stateBin"; import localforage from "localforage"; import MediaRoulette from "../MediaRoulette.svelte"; import type { Title } from "../mediaTitle"; -import aprilFools from "$stores/aprilFools"; -import { executiveCopy, executiveTitle } from "$lib/Utility/executiveMode"; export let media: Media[]; export let title: Title; @@ -224,7 +222,7 @@ const increment = (anime: Media, progress: number) => { count={$settings.displayTotalDueEpisodes || $settings.displayTotalEpisodes ? totalEpisodeDueCount : filteredMedia.length} - title={executiveTitle($aprilFools, title)} + {title} hideTime={dummy} hideCount={dummy} > @@ -232,17 +230,16 @@ const increment = (anime: Media, progress: number) => { <button class="small-button" onclick={() => (showRoulette = true)} - title={executiveCopy($aprilFools, "Roulette")} + title="Pick a random anime to watch" > - {executiveCopy($aprilFools, "Roulette")} + Roulette </button> {/if} </ListTitle> {#if media.length === 0} - {$aprilFools ? "No deliverables to display." : "No anime to display."} - <button onclick={() => (animeLists = cleanCache(user, $identity))}> - {executiveCopy($aprilFools, "Force refresh")} + No anime to display. <button onclick={() => (animeLists = cleanCache(user, $identity))}> + Force refresh </button> {:else if $settings.displayMediaListFilter && !disableFilter} <select value={selectedList} onchange={updateSelectedList}> diff --git a/src/lib/List/Anime/DueAnimeList.svelte b/src/lib/List/Anime/DueAnimeList.svelte index 8e6cb0ef..2c707ffb 100644 --- a/src/lib/List/Anime/DueAnimeList.svelte +++ b/src/lib/List/Anime/DueAnimeList.svelte @@ -14,8 +14,6 @@ import { hasNoAiredEpisodes, } from "$lib/Media/Anime/Airing/classify"; import { addNotification } from "$lib/Notification/store"; -import { executiveTitle } from "$lib/Utility/executiveMode"; -import aprilFools from "$stores/aprilFools"; import locale from "$stores/locale"; import identity from "$stores/identity"; @@ -155,10 +153,4 @@ const cleanMedia = ( }; </script> -<AnimeList - {endTime} - {cleanMedia} - bind:animeLists - {user} - title={executiveTitle($aprilFools, $locale().lists.due.episodes)} -/> +<AnimeList {endTime} {cleanMedia} bind:animeLists {user} title={$locale().lists.due.episodes} /> diff --git a/src/lib/List/Anime/UpcomingAnimeList.svelte b/src/lib/List/Anime/UpcomingAnimeList.svelte index 6bee4955..d9b91122 100644 --- a/src/lib/List/Anime/UpcomingAnimeList.svelte +++ b/src/lib/List/Anime/UpcomingAnimeList.svelte @@ -12,8 +12,6 @@ import type { SubsPlease } from "$lib/Media/Anime/Airing/Subtitled/subsPlease"; import { addNotification } from "$lib/Notification/store"; import locale from "$stores/locale"; import identity from "$stores/identity"; -import aprilFools from "$stores/aprilFools"; -import { executiveTitle } from "$lib/Utility/executiveMode"; import { injectAiringTime } from "$lib/Media/Anime/Airing/Subtitled/match"; import { hasDueEpisodes, @@ -122,7 +120,7 @@ $: { {cleanMedia} bind:animeLists {user} - title={executiveTitle($aprilFools, $locale().lists.upcoming.episodes)} + title={$locale().lists.upcoming.episodes} upcoming /> @@ -134,7 +132,7 @@ $: { {cleanMedia} bind:animeLists {user} - title={executiveTitle($aprilFools, $locale().lists.upcoming.notYetReleased)} + title={$locale().lists.upcoming.notYetReleased} notYetReleased plannedOnly /> diff --git a/src/lib/List/ListTitle.svelte b/src/lib/List/ListTitle.svelte index 535d0807..d000e91f 100644 --- a/src/lib/List/ListTitle.svelte +++ b/src/lib/List/ListTitle.svelte @@ -1,7 +1,5 @@ <script lang="ts"> import tooltip from "$lib/Tooltip/tooltip"; -import { executiveCopy } from "$lib/Utility/executiveMode"; -import aprilFools from "$stores/aprilFools"; import type { Title } from "./mediaTitle"; export let time: number | undefined = undefined; @@ -16,9 +14,7 @@ export let hideCount = false; </script> <summary> - <span title={title.hint || undefined} use:tooltip - >{executiveCopy($aprilFools, title.title)}</span - > + <span title={title.hint || undefined} use:tooltip>{title.title}</span> {#if !hideCount}[{count === -1337 ? '...' : count}]{/if} <!-- {#if !hideCount}[{#if count === -1337}...{:else}<NumberTicker end={count} diff --git a/src/lib/List/Manga/CleanMangaList.svelte b/src/lib/List/Manga/CleanMangaList.svelte index aab8be97..56de1df1 100644 --- a/src/lib/List/Manga/CleanMangaList.svelte +++ b/src/lib/List/Manga/CleanMangaList.svelte @@ -22,14 +22,12 @@ import settings from "$stores/settings"; import ListTitle from "../ListTitle.svelte"; import { onMount } from "svelte"; import root from "$lib/Utility/root"; -import { executiveCopy, executiveTitle } from "$lib/Utility/executiveMode"; import locale from "$stores/locale"; import Skeleton from "$lib/Loading/Skeleton.svelte"; import { browser } from "$app/environment"; import "../covers.css"; import CleanGrid from "../CleanGrid.svelte"; import CleanList from "../CleanList.svelte"; -import aprilFools from "$stores/aprilFools"; import stateBin from "$stores/stateBin"; import localforage from "localforage"; import MediaRoulette from "../MediaRoulette.svelte"; @@ -124,30 +122,26 @@ const increment = (manga: Media) => { ? totalEpisodeDueCount : filteredMedia.length} time={endTime / 1000} - title={executiveTitle( - $aprilFools, - due - ? $locale().lists.due.mangaAndLightNovels - : $locale().lists.completed.mangaAndLightNovels, - )} + title={due + ? $locale().lists.due.mangaAndLightNovels + : $locale().lists.completed.mangaAndLightNovels} hideTime={dummy} hideCount={dummy} > {#if !dummy} <button class="small-button" - title={executiveCopy($aprilFools, "Force refresh")} + title="Force a full refresh" onclick={cleanCache} - data-umami-event="Force Refresh Manga" - >{executiveCopy($aprilFools, "Refresh")}</button + data-umami-event="Force Refresh Manga">Refresh</button > {#if $settings.displayMediaRoulette && filteredMedia.length > 0} <button class="small-button" onclick={() => (showRoulette = true)} - title={executiveCopy($aprilFools, "Pick a random manga to read")} + title="Pick a random manga to read" > - {executiveCopy($aprilFools, "Roulette")} + Roulette </button> {/if} {/if} @@ -183,9 +177,8 @@ const increment = (manga: Media) => { {/if} <p> - {$aprilFools ? "No deliverables to display." : "No manga to display."} - <button onclick={cleanCache} data-umami-event="Force Refresh No Manga" - >{executiveCopy($aprilFools, "Force refresh")}</button + No manga to display. <button onclick={cleanCache} data-umami-event="Force Refresh No Manga" + >Force refresh</button > </p> diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte index daa3a27b..52649098 100644 --- a/src/lib/List/Manga/MangaListTemplate.svelte +++ b/src/lib/List/Manga/MangaListTemplate.svelte @@ -15,8 +15,6 @@ import { chapterCount, hydrateChapterCounts } from "$lib/Media/Manga/chapters"; import { options } from "$lib/Notification/options"; import { addNotification } from "$lib/Notification/store"; import privilegedUser from "$lib/Utility/privilegedUser"; -import { executiveCopy, executiveTitle } from "$lib/Utility/executiveMode"; -import aprilFools from "$stores/aprilFools"; import identity from "$stores/identity"; import lastPruneTimes from "$stores/lastPruneTimes"; import locale from "$stores/locale"; @@ -52,13 +50,6 @@ let keyCacher: ReturnType<typeof setInterval> | undefined; let keyCacheMinutes = -1; let nativeEnhancementVersion = 0; let nativeEnhancementKey = ""; -const mangaListTitle = () => - executiveTitle( - $aprilFools, - due - ? $locale().lists.due.mangaAndLightNovels - : $locale().lists.completed.mangaAndLightNovels, - ); $: authorised = env.PUBLIC_ALWAYS_REFRESH_MANGA === "true" || privilegedUser($identity.id); @@ -375,26 +366,26 @@ const cleanCache = () => { <ListTitle count={0} time={endTime / 1000} - title={mangaListTitle()} + title={$locale().lists.due.mangaAndLightNovels} hideTime={dummy} hideCount={dummy} > {#if !dummy} <button data-umami-event="Force Refresh Manga" - title={executiveCopy($aprilFools, "Force refresh")} + title="Force a full refresh" onclick={() => { cleanCache(); forceFlag = true; - }}>{executiveCopy($aprilFools, "Refresh")}</button + }}>Refresh</button > {/if} </ListTitle> {:else} <ListTitle {progress} - title={mangaListTitle()} + title={$locale().lists.due.mangaAndLightNovels} hideTime={dummy} hideCount={dummy} /> @@ -424,26 +415,26 @@ const cleanCache = () => { <ListTitle count={0} time={endTime / 1000} - title={mangaListTitle()} + title={$locale().lists.due.mangaAndLightNovels} hideTime={dummy} hideCount={dummy} > {#if !dummy} <button data-umami-event="Force Refresh Manga" - title={executiveCopy($aprilFools, "Force refresh")} + title="Force a full refresh" onclick={() => { cleanCache(); forceFlag = true; - }}>{executiveCopy($aprilFools, "Refresh")}</button + }}>Refresh</button > {/if} </ListTitle> {:else} <ListTitle {progress} - title={mangaListTitle()} + title={$locale().lists.due.mangaAndLightNovels} hideTime={dummy} hideCount={dummy} /> @@ -456,19 +447,19 @@ const cleanCache = () => { <ListTitle count={cleanedMedia.length} time={endTime / 1000} - title={mangaListTitle()} + title={$locale().lists.due.mangaAndLightNovels} hideTime={dummy} hideCount={dummy} > {#if !dummy} <button data-umami-event="Force Refresh Manga" - title={executiveCopy($aprilFools, "Force refresh")} + title="Force a full refresh" onclick={() => { cleanCache(); forceFlag = true; - }}>{executiveCopy($aprilFools, "Refresh")}</button + }}>Refresh</button > {/if} </ListTitle> @@ -493,7 +484,7 @@ const cleanCache = () => { <ListTitle count={-1337} time={0} - title={mangaListTitle()} + title={$locale().lists.due.mangaAndLightNovels} hideTime={dummy} hideCount={dummy} /> diff --git a/src/lib/Utility/executiveMode.ts b/src/lib/Utility/executiveMode.ts deleted file mode 100644 index c7b76b02..00000000 --- a/src/lib/Utility/executiveMode.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { Title } from "$lib/List/mediaTitle"; - -const copyMap: Record<string, string> = { - Home: "Dashboard", - ホーム: "ダッシュボード", - Completed: "Archive", - 完結メディア: "アーカイブ", - Schedule: "Roadmap", - スケジュール: "ロードマップ", - 字幕放送スケジュール: "字幕ロードマップ", - Tools: "Utilities", - ツール: "ユーティリティ", - Settings: "Preferences", - 設定: "環境設定", - Profile: "Associate", - "Log in with AniList": "Authenticate with AniList", - AniListでログインする: "AniListで認証する", - "My Profile": "My Employee Profile", - バッジウォール: "表彰ウォール", - プロフィール: "社員プロフィール", - "My Badge Wall": "My Recognition Wall", - "Log out": "End Session", - ログアウト: "セッション終了", - "Due Episodes": "Action Items", - 追いつくべきエピソード: "対応項目", - "Upcoming Episodes": "Pipeline", - 今後のエピソード: "パイプライン", - "Not Yet Released": "Planned Deliverables", - 未公開: "計画中の成果物", - Anime: "Deliverables", - アニメ: "成果物", - "Manga & Light Novels": "Documentation Backlog", - "漫画&ライトノベル": "ドキュメントバックログ", - "New Releases": "New Deliverables", - 新着リリース: "新着成果物", - Refresh: "Quarterly Review", - Roulette: "Strategic Prioritisation", - "Refresh data": "Realign KPIs", - "Force refresh": "Force quarterly review", -}; - -export const executiveCopy = (enabled: boolean, text: string) => - enabled ? copyMap[text] || text : text; - -export const executiveTitle = (enabled: boolean, title: Title): Title => - enabled - ? { - ...title, - title: executiveCopy(enabled, title.title), - } - : title; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 35555269..39a2e40b 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -28,17 +28,11 @@ import settingsSyncPulled from "$stores/settingsSyncPulled"; import settingsSyncTimes from "$stores/settingsSyncTimes"; import Announcement from "$lib/Announcement.svelte"; import Message from "$lib/Loading/Message.svelte"; -import { addNotification } from "$lib/Notification/store"; import { requestNotifications } from "$lib/Utility/notifications"; -import { executiveCopy } from "$lib/Utility/executiveMode"; import { database as userDatabase } from "$lib/Database/IDB/user"; import CommandPalette from "$lib/CommandPalette/CommandPalette.svelte"; import { defaultActions } from "$lib/CommandPalette/actions"; import { toolsAsCommandPaletteActions } from "$lib/Tools/tools"; -import aprilFools, { - aprilFoolsVisible, - hydrateAprilFools, -} from "$stores/aprilFools"; import localforage from "localforage"; import { dev } from "$app/environment"; import { injectAnalytics } from "@vercel/analytics/sveltekit"; @@ -54,23 +48,6 @@ let previousScrollPosition = 0; let notificationInterval: ReturnType<typeof setInterval> | undefined = undefined; -const notifyExecutiveMode = (enabled: boolean) => { - addNotification({ - heading: "April Fools", - description: enabled - ? "Executive Mode has been activated for April Fools. All media are now deliverables. Use the header control if you need to revert to standard operations." - : "Executive Mode is off. Toggle it from the header if you want the April Fools joke back.", - duration: 5000, - }); -}; - -const toggleExecutiveMode = () => { - const nextEnabled = !$aprilFools; - - aprilFools.set(nextEnabled); - notifyExecutiveMode(nextEnabled); -}; - addMessages("en", english as unknown as LocaleDictionary); addMessages("ja", japanese as unknown as LocaleDictionary); init({ fallbackLocale: "en", initialLocale: $settings.displayLanguage }); @@ -113,17 +90,7 @@ const handleScroll = () => { }; onMount(async () => { - hydrateAprilFools(); - if (browser) { - if ( - aprilFoolsVisible() && - (await localforage.getItem("aprilFoolsNoticeShown")) !== data.commit - ) { - notifyExecutiveMode($aprilFools); - await localforage.setItem("aprilFoolsNoticeShown", data.commit); - } - if (await localforage.getItem("redirect")) { window.location.href = (await localforage.getItem("redirect")) ?? "/"; @@ -249,66 +216,38 @@ $: { <div class="container"> <div class="card card-centered header" class:header-hidden={!isHeaderVisible}> <div> - <a href={root('/')} class="header-item" - >{executiveCopy($aprilFools, $locale().navigation.home)}</a - ><a + <a href={root('/')} class="header-item">{$locale().navigation.home}</a><a href={root('/completed')} class="header-item" > - {executiveCopy($aprilFools, $locale().navigation.completed)} + {$locale().navigation.completed} </a> <Dropdown items={[ - { - name: executiveCopy($aprilFools, $locale().navigation.subtitleSchedule), - url: root('/schedule') - }, + { name: $locale().navigation.subtitleSchedule, url: root('/schedule') }, { name: $locale().navigation.hololive, url: root('/hololive') }, { name: $locale().tools.tool.characterBirthdays.short, url: root('/birthdays') }, - { name: executiveCopy($aprilFools, $locale().navigation.newReleases), url: root('/updates') } + { name: $locale().navigation.newReleases, url: root('/updates') } ]} header={false} > - <span slot="title" class="header-item"> - {executiveCopy($aprilFools, $locale().navigation.schedule)} - </span> + <span slot="title" class="header-item">{$locale().navigation.schedule}</span> </Dropdown> - <a href={root('/tools')} class="header-item" - >{executiveCopy($aprilFools, $locale().navigation.tools)}</a - > - <a href={root('/settings')} class="header-item" - >{executiveCopy($aprilFools, $locale().navigation.settings)}</a - > - {#if aprilFoolsVisible()} - <span class="header-item opaque separator">•</span> - <a - href={root(data.url)} - class="header-item executive-mode-toggle" - onclick={(event) => { - event.preventDefault(); - toggleExecutiveMode(); - }} - title={$aprilFools ? 'Disable Executive Mode' : 'Enable Executive Mode'} - > - Executive {$aprilFools ? 'On' : 'Off'} - </a> - {/if} + <a href={root('/tools')} class="header-item">{$locale().navigation.tools}</a> + <a href={root('/settings')} class="header-item">{$locale().navigation.settings}</a> <span class="header-item opaque separator">•</span> {#if data.user} <Dropdown items={[ + { name: $locale().navigation.myProfile, url: root(`/user/${$userIdentity.name}`) }, { - name: executiveCopy($aprilFools, $locale().navigation.myProfile), - url: root(`/user/${$userIdentity.name}`) - }, - { - name: executiveCopy($aprilFools, $locale().navigation.myBadgeWall), + name: $locale().navigation.myBadgeWall, url: root(`/user/${$userIdentity.name}/badges`) }, { - name: executiveCopy($aprilFools, $locale().navigation.logOut), + name: $locale().navigation.logOut, url: '#', preventDefault: true, onClick: async () => { @@ -324,7 +263,7 @@ $: { header={false} > <span slot="title" class="header-item"> - {executiveCopy($aprilFools, $locale().navigation.profile)} + {$locale().navigation.profile} </span> </Dropdown> {/if} @@ -340,7 +279,7 @@ $: { ); }} > - {executiveCopy($aprilFools, $locale().navigation.logIn)} + {$locale().navigation.logIn} </a> {:else if data.user} <a href={root(`/user/${$userIdentity.name}`)} class="header-item"> @@ -434,18 +373,6 @@ $: { outline: none; } - .executive-mode-toggle { - background: none; - border: none; - cursor: pointer; - font: inherit; - padding: 0; - } - - .executive-mode-toggle:hover { - text-decoration: none; - } - .avatar { width: 2em; display: inline-block; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index a3fcad28..268e9713 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -8,8 +8,6 @@ import ListTitle from "$lib/List/ListTitle.svelte"; import HeadTitle from "$lib/Home/HeadTitle.svelte"; import { createHeightObserver } from "$lib/Utility/html.js"; import Skeleton from "$lib/Loading/Skeleton.svelte"; -import aprilFools from "$stores/aprilFools"; -import { executiveTitle } from "$lib/Utility/executiveMode"; import locale from "$stores/locale.js"; import Landing from "$lib/Landing.svelte"; import LandingHero from "$lib/LandingHero.svelte"; @@ -108,12 +106,12 @@ onDestroy(() => removeHeightObserver?.()); {#if UpcomingAnimeListComponent} <UpcomingAnimeListComponent user={data.user} /> {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.upcoming.episodes)} /> + <ListTitle title={$locale().lists.upcoming.episodes} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.upcoming.episodes)} /> + <ListTitle title={$locale().lists.upcoming.episodes} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} @@ -125,7 +123,7 @@ onDestroy(() => removeHeightObserver?.()); <IndexColumnComponent user={data.user} userIdentity={$userIdentity} /> {:else} <details bind:open={$stateBin.dueAnimeListOpen} class="list list-due"> - <ListTitle title={executiveTitle($aprilFools, $locale().lists.due.episodes)} /> + <ListTitle title={$locale().lists.due.episodes} /> <Skeleton card={false} count={5} height="0.9rem" list /> </details> @@ -139,7 +137,7 @@ onDestroy(() => removeHeightObserver?.()); <IndexColumnComponent user={data.user} userIdentity={$userIdentity} /> {:else} <details bind:open={$stateBin.dueAnimeListOpen} class="list list-due"> - <ListTitle title={executiveTitle($aprilFools, $locale().lists.due.episodes)} /> + <ListTitle title={$locale().lists.due.episodes} /> <Skeleton card={false} count={5} height="0.9rem" list /> </details> @@ -156,12 +154,12 @@ onDestroy(() => removeHeightObserver?.()); due={true} /> {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.due.mangaAndLightNovels)} /> + <ListTitle title={$locale().lists.due.mangaAndLightNovels} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.due.mangaAndLightNovels)} /> + <ListTitle title={$locale().lists.due.mangaAndLightNovels} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} diff --git a/src/routes/completed/+page.svelte b/src/routes/completed/+page.svelte index 69706b8e..bcad912b 100644 --- a/src/routes/completed/+page.svelte +++ b/src/routes/completed/+page.svelte @@ -9,8 +9,6 @@ import HeadTitle from "$lib/Home/HeadTitle.svelte"; import { createHeightObserver } from "$lib/Utility/html.js"; import Skeleton from "$lib/Loading/Skeleton.svelte"; import locale from "$stores/locale.js"; -import aprilFools from "$stores/aprilFools"; -import { executiveTitle } from "$lib/Utility/executiveMode"; import Landing from "$lib/Landing.svelte"; import stateBin, { hydrateStateBin } from "$stores/stateBin.js"; import type { PageData } from "./$types"; @@ -86,12 +84,12 @@ onDestroy(() => removeHeightObserver?.()); {#if WatchingAnimeListComponent} <WatchingAnimeListComponent user={data.user} /> {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.completed.anime)} /> + <ListTitle title={$locale().lists.completed.anime} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.completed.anime)} /> + <ListTitle title={$locale().lists.completed.anime} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} @@ -108,12 +106,12 @@ onDestroy(() => removeHeightObserver?.()); due={false} /> {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.completed.mangaAndLightNovels)} /> + <ListTitle title={$locale().lists.completed.mangaAndLightNovels} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} {:else} - <ListTitle title={executiveTitle($aprilFools, $locale().lists.completed.mangaAndLightNovels)} /> + <ListTitle title={$locale().lists.completed.mangaAndLightNovels} /> <Skeleton card={false} count={5} height="0.9rem" list /> {/if} diff --git a/src/stores/aprilFools.ts b/src/stores/aprilFools.ts deleted file mode 100644 index d86829c1..00000000 --- a/src/stores/aprilFools.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { browser } from "$app/environment"; -import { writable } from "svelte/store"; - -const storageKey = (date = new Date()) => - `aprilFoolsExecutiveMode:${date.getFullYear()}`; - -export const isAprilFoolsDay = (date = new Date()) => - date.getMonth() === 3 && date.getDate() === 1; - -let hydrated = !browser; - -const store = writable(false); - -export const hydrateAprilFools = () => { - if (!browser || hydrated) return; - - const storedValue = localStorage.getItem(storageKey()); - - store.set(storedValue === null ? isAprilFoolsDay() : storedValue === "true"); - hydrated = true; -}; - -store.subscribe((value) => { - if (!browser || !hydrated) return; - - localStorage.setItem(storageKey(), String(value)); -}); - -export const aprilFoolsVisible = () => isAprilFoolsDay(); - -const aprilFools = { - subscribe: store.subscribe, - set: store.set, - toggle: () => store.update((value) => !value), -}; - -export default aprilFools; |