From 5758ea463a9470365de157c69354f12b46580c03 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Mon, 21 Aug 2023 18:52:20 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E7=A4=BA=E7=8A=B6=E6=85=8B=E3=82=92=E8=A8=98?= =?UTF-8?q?=E6=86=B6=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20(#1134?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: keep show showPreview * docs(changelog): add プレビューの表示した状態ををダイアログを閉じても保存するように * chore: 記憶する領域をdeviceに --- CHANGELOG.md | 1 + packages/frontend/src/components/MkPostForm.vue | 3 ++- packages/frontend/src/store.ts | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddfe7cdcf4..c2af31fce0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ ### Client - リストTLで、ユーザーが追加・削除されてもTLを初期化しないように - URL取得変数を関数に変更 CURRENT_URL -> Mk:url() +- プレビューの表示状態を記憶するように - Fix: モバイル表示のときページ下部がナビゲーションバーに隠れる問題を修正 - Fix: 一部モーダルダイアログでスクロールできない問題を修正 - Fix: Selecting all emojis in Custom emoji is impossible diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index afbec98d61..cbf0d8d871 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -171,7 +171,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 1cb3486f74..e9f672384e 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -135,6 +135,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'deviceAccount', default: false, }, + showPreview: { + where: 'device', + default: false, + }, statusbars: { where: 'deviceAccount', default: [] as {