fix: default reply to visibility (urgent) (#194)

This commit is contained in:
patak 2022-11-28 10:57:42 +01:00 committed by GitHub
parent 0843878a42
commit 8076e5f069
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View file

@ -8,16 +8,18 @@ const {
draftKey,
placeholder = 'What is on your mind?',
inReplyToId,
inReplyToVisibility = 'public',
expanded: _expanded = false,
} = defineProps<{
draftKey: string
placeholder?: string
inReplyToId?: string
inReplyToVisibility?: StatusVisibility
expanded?: boolean
}>()
let isSending = $ref(false)
let { draft } = $(useDraft(draftKey, inReplyToId))
let { draft } = $(useDraft(draftKey, inReplyToId, inReplyToVisibility))
const isExistDraft = $computed(() => !!draft.params.status && draft.params.status !== '<p></p>')
let isExpanded = $ref(isExistDraft || _expanded)
@ -119,7 +121,7 @@ async function publish() {
else
await useMasto().statuses.update(draft.editingStatus.id, payload)
draft = getDefaultDraft({ inReplyToId })
draft = getDefaultDraft({ inReplyToId, visibility: inReplyToVisibility })
isPublishDialogOpen.value = false
}
finally {