プレビューの表示状態を記憶するように (#11346)

* feat: keep show showPreview

* docs(changelog): add プレビューの表示した状態ををダイアログを閉じても保存するように

* chore: 記憶する領域をdeviceに
This commit is contained in:
anatawa12 2023-08-21 18:52:20 +09:00 committed by GitHub
parent f664f941a2
commit 5758ea463a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -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<string | null>(null);
let localOnly = $ref<boolean>(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]);