テーマをレジストリに保存するように

This commit is contained in:
syuilo
2021-01-11 22:31:17 +09:00
parent 20e67e7edd
commit 114a9fbdb2
6 changed files with 78 additions and 12 deletions

View File

@@ -77,6 +77,7 @@ import { isDeviceDarkmode } from '@/scripts/is-device-darkmode';
import { ColdDeviceStorage } from '@/store';
import { i18n } from '@/i18n';
import { defaultStore } from '@/store';
import { fetchThemes, getThemes } from '@/theme-store';
export default defineComponent({
components: {
@@ -96,7 +97,7 @@ export default defineComponent({
icon: faPalette
};
const installedThemes = ColdDeviceStorage.ref('themes');
const installedThemes = ref(getThemes());
const themes = computed(() => builtinThemes.concat(installedThemes.value));
const darkThemes = computed(() => themes.value.filter(t => t.base == 'dark' || t.kind == 'dark'));
const lightThemes = computed(() => themes.value.filter(t => t.base == 'light' || t.kind == 'light'));
@@ -137,6 +138,10 @@ export default defineComponent({
emit('info', INFO);
});
fetchThemes().then(() => {
installedThemes.value = getThemes();
});
return {
INFO,
darkThemes,