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

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

@@ -37,6 +37,7 @@ import { Theme, builtinThemes } from '@/scripts/theme';
import copyToClipboard from '@/scripts/copy-to-clipboard';
import * as os from '@/os';
import { ColdDeviceStorage } from '@/store';
import { getThemes, removeTheme } from '@/theme-store';
export default defineComponent({
components: {
@@ -57,7 +58,7 @@ export default defineComponent({
title: this.$ts._theme.manage,
icon: faFolderOpen
},
installedThemes: ColdDeviceStorage.ref('themes'),
installedThemes: getThemes(),
builtinThemes,
selectedThemeId: null,
faPalette, faDownload, faFolderOpen, faCheck, faTrashAlt, faEye
@@ -91,10 +92,7 @@ export default defineComponent({
},
uninstall() {
const theme = this.selectedTheme;
const themes = ColdDeviceStorage.get('themes').filter(t => t.id != theme.id);
ColdDeviceStorage.set('themes', themes);
os.success();
removeTheme(this.selectedTheme);
},
}
});