From d886dddbf12159be83e15c46bb177e39548ae2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Tue, 25 Jul 2023 03:31:21 +0900 Subject: [PATCH] feat: keep show showPreview (#111) Co-authored-by: anatawa12 --- packages/frontend/src/components/MkPostForm.vue | 3 ++- packages/frontend/src/store.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index f516ccbad..daf200399 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -166,7 +166,8 @@ let poll = $ref<{ expiredAfter: string | null; } | null>(null); let useCw = $ref(false); -let showPreview = $ref(false); +let showPreview = $ref(defaultStore.state.showPreview); +watch($$(showPreview), () => defaultStore.set('showPreview', showPreview)); let cw = $ref(null); let localOnly = $ref(props.initialLocalOnly ?? defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly); let visibility = $ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof misskey.noteVisibilities[number]); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 6ba05c36a..52421330a 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -130,6 +130,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'deviceAccount', default: false, }, + showPreview: { + where: 'deviceAccount', + default: false, + }, statusbars: { where: 'deviceAccount', default: [] as {