enhance(frontend): ウィジェットもpreference管理に

This commit is contained in:
syuilo
2025-03-09 15:13:49 +09:00
parent 2918fb2609
commit 69eee9f050
8 changed files with 57 additions and 61 deletions

View File

@@ -106,7 +106,6 @@ import type MkStickyContainer from '@/components/global/MkStickyContainer.vue';
import type { PageMetadata } from '@/utility/page-metadata.js';
import XDrawerMenu from '@/ui/_common_/navbar-for-mobile.vue';
import * as os from '@/os.js';
import { store } from '@/store.js';
import { navbarItemDef } from '@/navbar.js';
import { i18n } from '@/i18n.js';
import { $i } from '@/account.js';
@@ -178,20 +177,18 @@ if (window.innerWidth > 1024) {
}
}
store.loaded.then(() => {
if (store.state.widgets.length === 0) {
store.set('widgets', [{
name: 'calendar',
id: 'a', place: 'right', data: {},
}, {
name: 'notifications',
id: 'b', place: 'right', data: {},
}, {
name: 'trends',
id: 'c', place: 'right', data: {},
}]);
}
});
if (prefer.s.widgets.length === 0) {
prefer.set('widgets', [{
name: 'calendar',
id: 'a', place: 'right', data: {},
}, {
name: 'notifications',
id: 'b', place: 'right', data: {},
}, {
name: 'trends',
id: 'c', place: 'right', data: {},
}]);
}
onMounted(() => {
if (!isDesktop.value) {