テーマをレジストリに保存するように
This commit is contained in:
@@ -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);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user