diff options
| author | Fuwn <[email protected]> | 2026-04-28 05:34:14 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-28 05:34:14 -0700 |
| commit | 1e149a29f6732c245364aa551fd08e2991310d98 (patch) | |
| tree | cbafe7526a00309a44a66e11913e8c3b7147f208 | |
| parent | refactor(airing): unify countdown formatter into shared helper (diff) | |
| download | due.moe-main.tar.xz due.moe-main.zip | |
| -rw-r--r-- | src/lib/CommandPalette/syncActions.ts | 8 | ||||
| -rw-r--r-- | src/lib/CommandPalette/toggleActions.ts | 4 | ||||
| -rw-r--r-- | src/lib/Media/Anime/Airing/format.ts | 7 | ||||
| -rw-r--r-- | src/lib/Media/Anime/Airing/time.ts | 4 |
4 files changed, 14 insertions, 9 deletions
diff --git a/src/lib/CommandPalette/syncActions.ts b/src/lib/CommandPalette/syncActions.ts index c787f348..49859221 100644 --- a/src/lib/CommandPalette/syncActions.ts +++ b/src/lib/CommandPalette/syncActions.ts @@ -41,9 +41,7 @@ export const syncActions = ( lastPush: new Date(), })); }) - .catch((error) => - console.error("Settings sync push failed", error), - ); + .catch((error) => console.error("Settings sync push failed", error)); }, }, { @@ -82,9 +80,7 @@ export const syncActions = ( ); }); }) - .catch((error) => - console.error("Settings sync pull failed", error), - ); + .catch((error) => console.error("Settings sync pull failed", error)); }, }, ]; diff --git a/src/lib/CommandPalette/toggleActions.ts b/src/lib/CommandPalette/toggleActions.ts index b93b5626..ca64ff5f 100644 --- a/src/lib/CommandPalette/toggleActions.ts +++ b/src/lib/CommandPalette/toggleActions.ts @@ -45,7 +45,9 @@ export const toggleActions = (current: Settings): CommandPaletteAction[] => { const titleIndex = TITLE_FORMATS.indexOf(current.displayTitleFormat); const nextTitle = TITLE_FORMATS[(titleIndex + 1) % TITLE_FORMATS.length]; - const outboundIndex = OUTBOUND_TARGETS.indexOf(current.displayOutboundLinksTo); + const outboundIndex = OUTBOUND_TARGETS.indexOf( + current.displayOutboundLinksTo, + ); const nextOutbound = OUTBOUND_TARGETS[(outboundIndex + 1) % OUTBOUND_TARGETS.length]; diff --git a/src/lib/Media/Anime/Airing/format.ts b/src/lib/Media/Anime/Airing/format.ts index 5fec3cc8..a7819999 100644 --- a/src/lib/Media/Anime/Airing/format.ts +++ b/src/lib/Media/Anime/Airing/format.ts @@ -10,7 +10,12 @@ type Result = { few: boolean; }; -const plural = (value: number, short: boolean, longUnit: string, shortUnit: string) => +const plural = ( + value: number, + short: boolean, + longUnit: string, + shortUnit: string, +) => `${value}${short ? shortUnit : ` ${longUnit}`}${value === 1 || short ? "" : "s"}`; export const formatCountdown = ( diff --git a/src/lib/Media/Anime/Airing/time.ts b/src/lib/Media/Anime/Airing/time.ts index b7547dd2..97f8818a 100644 --- a/src/lib/Media/Anime/Airing/time.ts +++ b/src/lib/Media/Anime/Airing/time.ts @@ -39,7 +39,9 @@ export const airingTime = ( ).toLocaleDateString()}</span>`; if (untilAiring !== undefined) { - const { text: timeFrame, few } = formatCountdown(untilAiring, { forceDays }); + const { text: timeFrame, few } = formatCountdown(untilAiring, { + forceDays, + }); const opacity = Math.max(50, 100 - (untilAiring / 60 / 60 / 24 / 7) * 50); const nextEpisode = anime.nextAiringEpisode?.nativeAiringAt && |