/
githubmirror
/
halo
Обзор
Документация
Войти
/
githubmirror
/
halo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ui/console-src/stores/theme.ts
29 строк
758 B
Ryan Wang
Rename `@halo-dev/console-shared` to `@halo-dev/ui-shared` (#7926)
10 ноя 2025, 19:20
Не верифицирован
10 ноя 2025, 19:20
ac88ee7
Код
Авторство
О чём код?
import type { Theme } from "@halo-dev/api-client"; import { consoleApiClient } from "@halo-dev/api-client"; import { utils } from "@halo-dev/ui-shared"; import { defineStore } from "pinia"; import { ref } from "vue"; export const useThemeStore = defineStore("theme", () => { const activatedTheme = ref<Theme>(); async function fetchActivatedTheme() { if (!utils.permission.has(["system:themes:view"])) { return; } try { const { data } = await consoleApiClient.theme.theme.fetchActivatedTheme({ mute: true, }); if (data) { activatedTheme.value = data; } } catch (e) { console.error("Failed to fetch active theme", e); } } return { activatedTheme, fetchActivatedTheme }; });