From 69d7cad5c113abead3398802f1a761150797fe5c Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sun, 21 Jun 2026 02:04:48 +0200 Subject: [PATCH] style: format static/player/skip/index.ts --- static/player/skip/index.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/static/player/skip/index.ts b/static/player/skip/index.ts index 2f1321a..daea804 100644 --- a/static/player/skip/index.ts +++ b/static/player/skip/index.ts @@ -1,15 +1,15 @@ -import { state } from "../state"; -import { displayTimeFromAbsolute, absoluteTimeFromDisplay } from "../timeline"; import { showControls } from "../controls"; import { saveProgress } from "../progress"; +import { state } from "../state"; import { safeLocalStorage } from "../storage"; +import { displayTimeFromAbsolute, absoluteTimeFromDisplay } from "../timeline"; // button label based on segment type const skipLabel = (type: string): string => (type === "ed" ? "Skip outro" : "Skip intro"); /** - * Updates skip button visibility and auto-skip logic. - * Called on timeupdate. Shows button when in active segment. + * Updates skip button visibility and auto-skip logic. Called on timeupdate. Shows button when in + * active segment. */ export const updateSkipButton = (currentTime: number): void => { const btn = state.elements.container.querySelector("[data-skip]") as HTMLButtonElement | null; @@ -46,22 +46,20 @@ export const updateSkipButton = (currentTime: number): void => { } }; -/** - * Syncs autoskip checkbox with localStorage. - */ +/** Syncs autoskip checkbox with localStorage. */ export const updateAutoSkipButton = (): void => { const btn = document.querySelector("[data-autoskip]") as HTMLInputElement | null; - if (!btn) return; + if (!btn) { + return; + } btn.checked = safeLocalStorage.getItem("mal:autoskip-enabled") === "true"; }; -/** - * Binds autoskip toggle change handler. - */ +/** Binds autoskip toggle change handler. */ export const setupSkip = (): void => { document.addEventListener("change", (e) => { const target = e.target as HTMLElement; - if (target.hasAttribute("data-autoskip")) { + if (Object.hasOwn(target.dataset, "autoskip")) { safeLocalStorage.setItem( "mal:autoskip-enabled", (target as HTMLInputElement).checked ? "true" : "false",