From 69eee9f05024776b1f3d4a16e9b52ced8b7152cd Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sun, 9 Mar 2025 15:13:49 +0900 Subject: enhance(frontend): ウィジェットもpreference管理に MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/ui/_common_/PreferenceRestore.vue | 9 -------- packages/frontend/src/ui/classic.vue | 26 ++++++++++----------- packages/frontend/src/ui/universal.vue | 27 ++++++++++------------ packages/frontend/src/ui/universal.widgets.vue | 26 ++++++++++----------- 4 files changed, 37 insertions(+), 51 deletions(-) (limited to 'packages/frontend/src/ui') diff --git a/packages/frontend/src/ui/_common_/PreferenceRestore.vue b/packages/frontend/src/ui/_common_/PreferenceRestore.vue index 0412733350..c70b82cd0e 100644 --- a/packages/frontend/src/ui/_common_/PreferenceRestore.vue +++ b/packages/frontend/src/ui/_common_/PreferenceRestore.vue @@ -39,15 +39,6 @@ function skip() { overflow: clip; contain: strict; background: var(--MI_THEME-panel); - - @container (max-width: 1000px) { - display: block; - text-align: center; - - > .body { - display: none; - } - } } .icon { diff --git a/packages/frontend/src/ui/classic.vue b/packages/frontend/src/ui/classic.vue index abe612ab3e..12791dba30 100644 --- a/packages/frontend/src/ui/classic.vue +++ b/packages/frontend/src/ui/classic.vue @@ -143,20 +143,18 @@ if (window.innerWidth < 1024) { document.documentElement.style.overflowY = 'scroll'; -store.loaded.then(() => { - if (store.state.widgets.length === 0) { - store.set('widgets', [{ - name: 'calendar', - id: 'a', place: null, data: {}, - }, { - name: 'notifications', - id: 'b', place: null, data: {}, - }, { - name: 'trends', - id: 'c', place: null, data: {}, - }]); - } -}); +if (prefer.s.widgets.length === 0) { + prefer.set('widgets', [{ + name: 'calendar', + id: 'a', place: null, data: {}, + }, { + name: 'notifications', + id: 'b', place: null, data: {}, + }, { + name: 'trends', + id: 'c', place: null, data: {}, + }]); +} onMounted(() => { window.addEventListener('resize', () => { diff --git a/packages/frontend/src/ui/universal.vue b/packages/frontend/src/ui/universal.vue index e012d615a8..633eca7542 100644 --- a/packages/frontend/src/ui/universal.vue +++ b/packages/frontend/src/ui/universal.vue @@ -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) { diff --git a/packages/frontend/src/ui/universal.widgets.vue b/packages/frontend/src/ui/universal.widgets.vue index 42b870cbb5..ea2b7f2cf2 100644 --- a/packages/frontend/src/ui/universal.widgets.vue +++ b/packages/frontend/src/ui/universal.widgets.vue @@ -19,7 +19,7 @@ const editMode = ref(false);