Storage improve (#6976)
* wip
* wip
* wip
* wip
* wip
* Update storage.ts
* wip
* wip
* wip
* wip
* Update storage.ts
* Update storage.ts
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update storage.ts
* wip
* wip
* wip
* wip
* 🍕
* wip
* wip
* wip
* wip
* wip
* wip
* Update deck-storage.ts
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update store.ts
* wip
* wip
* wip
* wip
* Update init.ts
* wip
* wip
* Update pizzax.ts
* wip
* wip
* Update timeline.vue
* Update init.ts
* wip
* wip
* Update init.ts
This commit is contained in:
@@ -34,6 +34,7 @@ import FormButton from '@/components/form/button.vue';
|
||||
import { Theme, builtinThemes } from '@/scripts/theme';
|
||||
import copyToClipboard from '@/scripts/copy-to-clipboard';
|
||||
import * as os from '@/os';
|
||||
import { ColdDeviceStorage } from '@/store';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@@ -54,6 +55,7 @@ export default defineComponent({
|
||||
title: this.$t('_theme.manage'),
|
||||
icon: faFolderOpen
|
||||
},
|
||||
installedThemes: ColdDeviceStorage.ref('themes'),
|
||||
builtinThemes,
|
||||
selectedThemeId: null,
|
||||
faPalette, faDownload, faFolderOpen, faCheck, faTrashAlt, faEye
|
||||
@@ -62,11 +64,7 @@ export default defineComponent({
|
||||
|
||||
computed: {
|
||||
themes(): Theme[] {
|
||||
return builtinThemes.concat(this.$store.state.device.themes);
|
||||
},
|
||||
|
||||
installedThemes(): Theme[] {
|
||||
return this.$store.state.device.themes;
|
||||
return this.builtinThemes.concat(this.installedThemes.value);
|
||||
},
|
||||
|
||||
selectedTheme() {
|
||||
@@ -92,10 +90,8 @@ export default defineComponent({
|
||||
|
||||
uninstall() {
|
||||
const theme = this.selectedTheme;
|
||||
const themes = this.$store.state.device.themes.filter(t => t.id != theme.id);
|
||||
this.$store.commit('device/set', {
|
||||
key: 'themes', value: themes
|
||||
});
|
||||
const themes = ColdDeviceStorage.get('themes').filter(t => t.id != theme.id);
|
||||
ColdDeviceStorage.set('themes', themes);
|
||||
os.success();
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user