diff --git a/packages/client/src/pages/settings/statusbars.statusbar.vue b/packages/client/src/pages/settings/statusbars.statusbar.vue index ad2fa557a..6b03ad46e 100644 --- a/packages/client/src/pages/settings/statusbars.statusbar.vue +++ b/packages/client/src/pages/settings/statusbars.statusbar.vue @@ -7,7 +7,7 @@ User list timeline - + Name @@ -15,14 +15,23 @@ Black + + Size + {{ i18n.ts.small }}+ + {{ i18n.ts.small }} + {{ i18n.ts.medium }} + {{ i18n.ts.large }} + {{ i18n.ts.large }}+ + + - + URL - + Refresh interval - + Duration @@ -30,10 +39,10 @@ - + Refresh interval - + Duration @@ -48,10 +57,10 @@ {{ i18n.ts.userList }} {{ list.name }} - + Refresh interval - + Duration @@ -60,7 +69,6 @@ - save Delete @@ -109,6 +117,8 @@ watch(() => statusbar.type, () => { } }); +watch(statusbar, save); + async function save() { const i = defaultStore.state.statusbars.findIndex(x => x.id === props._id); const statusbars = JSON.parse(JSON.stringify(defaultStore.state.statusbars)); diff --git a/packages/client/src/pages/settings/statusbars.vue b/packages/client/src/pages/settings/statusbars.vue index 18de11975..bcfff1652 100644 --- a/packages/client/src/pages/settings/statusbars.vue +++ b/packages/client/src/pages/settings/statusbars.vue @@ -6,14 +6,6 @@ add - - Size - {{ i18n.ts.small }}+ - {{ i18n.ts.small }} - {{ i18n.ts.medium }} - {{ i18n.ts.large }} - {{ i18n.ts.large }}+ - @@ -30,7 +22,6 @@ import { unisonReload } from '@/scripts/unison-reload'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; -const statusbarSize = computed(defaultStore.makeGetterSetter('statusbarSize')); const statusbars = defaultStore.reactiveState.statusbars; let userLists = $ref(); @@ -46,6 +37,7 @@ async function add() { id: uuid(), type: null, black: false, + size: 'medium', props: {}, }); } diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index cde907017..7ddab18f0 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -94,13 +94,11 @@ export const defaultStore = markRaw(new Storage('base', { name: string; id: string; type: string; + size: 'verySmall' | 'small' | 'medium' | 'large' | 'veryLarge'; + black: boolean; props: Record; }[], }, - statusbarSize: { - where: 'deviceAccount', - default: 'medium', - }, widgets: { where: 'deviceAccount', default: [] as { diff --git a/packages/client/src/ui/_common_/statusbar-user-list.vue b/packages/client/src/ui/_common_/statusbar-user-list.vue index 2757e9118..12533d05f 100644 --- a/packages/client/src/ui/_common_/statusbar-user-list.vue +++ b/packages/client/src/ui/_common_/statusbar-user-list.vue @@ -52,6 +52,8 @@ const tick = () => { }); }; +watch(() => props.userListId, tick); + useInterval(tick, Math.max(5000, props.refreshIntervalSec * 1000), { immediate: true, afterMounted: true, diff --git a/packages/client/src/ui/_common_/statusbars.vue b/packages/client/src/ui/_common_/statusbars.vue index c18771c54..c448b0956 100644 --- a/packages/client/src/ui/_common_/statusbars.vue +++ b/packages/client/src/ui/_common_/statusbars.vue @@ -1,14 +1,14 @@ - - + + {{ x.name }} @@ -28,37 +28,38 @@ const XUserList = defineAsyncComponent(() => import('./statusbar-user-list.vue')