From 5c50a677e86414de0fddf4c50d60debff6d1bead Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 22 Jul 2023 16:07:11 +0900 Subject: [PATCH] feat: keep show showPreview --- 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 f516ccbad8..daf2003998 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 6ba05c36ab..52421330ad 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 {