revert fb8e77bb68
Local Build and Deploy / deploy (push) Successful in 1m11s

revert style: clean up code with prettier and eslint
This commit is contained in:
remco committed 2026-07-12 21:02:03 +02:00
1 parent 27de078f54
commit e85e4d74ea
378 files changed
+20710 -22428

No files matched your search

+19 -19
View File
@@ -10,35 +10,35 @@
*/
export interface SoundtrackOption {
id: number;
code: string;
name: string;
author: string;
length: number;
id: number
code: string
name: string
author: string
length: number
}
let cachedOptions: SoundtrackOption[] | null = null;
let inflight: Promise<SoundtrackOption[]> | null = null;
let cachedOptions: SoundtrackOption[] | null = null
let inflight: Promise<SoundtrackOption[]> | null = null
export async function loadSongPickerOptions(): Promise<SoundtrackOption[]> {
if (cachedOptions) return cachedOptions;
if (inflight) return inflight;
if (cachedOptions) return cachedOptions
if (inflight) return inflight
inflight = (async () => {
const res = await fetch("/api/admin/sounds", { cache: "no-store" });
if (!res.ok) throw new Error("Failed to load soundtracks");
const json = (await res.json()) as { ok: boolean; items?: SoundtrackOption[] };
cachedOptions = json.items ?? [];
inflight = null;
return cachedOptions;
})();
return inflight;
const res = await fetch('/api/admin/sounds', { cache: 'no-store' })
if (!res.ok) throw new Error('Failed to load soundtracks')
const json = (await res.json()) as { ok: boolean; items?: SoundtrackOption[] }
cachedOptions = json.items ?? []
inflight = null
return cachedOptions
})()
return inflight
}
export function getCachedSongPickerOptions(): SoundtrackOption[] | null {
return cachedOptions;
return cachedOptions
}
/** Clear the cache so new uploads show up on next open. */
export function invalidateSongPickerCache(): void {
cachedOptions = null;
cachedOptions = null
}