This commit is contained in:
syuilo 2022-06-12 19:50:47 +09:00
parent a8e7b1a303
commit 4e89d41f04
2 changed files with 13 additions and 13 deletions

View File

@ -1,9 +1,9 @@
import { throttle } from 'throttle-debounce'; import { throttle } from 'throttle-debounce';
import { markRaw } from 'vue';
import { notificationTypes } from 'misskey-js';
import { Storage } from '../../pizzax';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { api } from '@/os'; import { api } from '@/os';
import { markRaw } from 'vue';
import { Storage } from '../../pizzax';
import { notificationTypes } from 'misskey-js';
type ColumnWidget = { type ColumnWidget = {
name: string; name: string;
@ -32,35 +32,35 @@ function copy<T>(x: T): T {
export const deckStore = markRaw(new Storage('deck', { export const deckStore = markRaw(new Storage('deck', {
profile: { profile: {
where: 'deviceAccount', where: 'deviceAccount',
default: 'default' default: 'default',
}, },
columns: { columns: {
where: 'deviceAccount', where: 'deviceAccount',
default: [] as Column[] default: [] as Column[],
}, },
layout: { layout: {
where: 'deviceAccount', where: 'deviceAccount',
default: [] as Column['id'][][] default: [] as Column['id'][][],
}, },
columnAlign: { columnAlign: {
where: 'deviceAccount', where: 'deviceAccount',
default: 'left' as 'left' | 'right' | 'center' default: 'left' as 'left' | 'right' | 'center',
}, },
alwaysShowMainColumn: { alwaysShowMainColumn: {
where: 'deviceAccount', where: 'deviceAccount',
default: true default: true,
}, },
navWindow: { navWindow: {
where: 'deviceAccount', where: 'deviceAccount',
default: true default: true,
}, },
columnMargin: { columnMargin: {
where: 'deviceAccount', where: 'deviceAccount',
default: 16 default: 16,
}, },
columnHeaderHeight: { columnHeaderHeight: {
where: 'deviceAccount', where: 'deviceAccount',
default: 42 default: 42,
}, },
})); }));
@ -109,7 +109,7 @@ export const saveDeck = throttle(1000, () => {
value: { value: {
columns: deckStore.reactiveState.columns.value, columns: deckStore.reactiveState.columns.value,
layout: deckStore.reactiveState.layout.value, layout: deckStore.reactiveState.layout.value,
} },
}); });
}); });

View File

@ -10,9 +10,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { } from 'vue'; import { } from 'vue';
import XWidgets from '@/components/widgets.vue';
import XColumn from './column.vue'; import XColumn from './column.vue';
import { addColumnWidget, Column, removeColumnWidget, setColumnWidgets, updateColumnWidget } from './deck-store'; import { addColumnWidget, Column, removeColumnWidget, setColumnWidgets, updateColumnWidget } from './deck-store';
import XWidgets from '@/components/widgets.vue';
const props = defineProps<{ const props = defineProps<{
column: Column; column: Column;