style: format code biome
Local Build and Deploy / deploy (push) Failing after 46s

This commit is contained in:
openhands committed 2026-07-13 21:57:41 +02:00
1 parent 8efd032cc6
commit df38dccbf1
735 files changed
+128321 -120870

No files matched your search

+21 -18
View File
@@ -10,35 +10,38 @@
*/
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;
export async function loadSongPickerOptions(): Promise<SoundtrackOption[]> {
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;
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;
}
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;
}