This commit is contained in:
syuilo
2023-02-22 15:28:17 +09:00
parent 3bb7afe544
commit 0fb9c372dd
22 changed files with 69 additions and 71 deletions

View File

@@ -1,13 +1,13 @@
import { api } from '@/os';
import { $i } from '@/account';
import { Theme } from './scripts/theme';
import { miLocalStorage } from './local-storage';
import { api } from '@/os';
import { $i } from '@/account';
const lsCacheKey = $i ? `themes:${$i.id}` as const : null;
export function getThemes(): Theme[] {
if ($i == null) return [];
return JSON.parse(miLocalStorage.getItem(lsCacheKey!) || '[]');
return JSON.parse(miLocalStorage.getItem(lsCacheKey!) ?? '[]');
}
export async function fetchThemes(): Promise<void> {