fix: character count should includes spoiler text (#1535)
* fix: character count should includes spoiler text * fix: draft empty conditions exclude spoiler text
This commit is contained in:
parent
04c4ff5225
commit
2bd8dc2dd5
3 changed files with 17 additions and 3 deletions
|
@ -35,7 +35,7 @@ const {
|
|||
dropZoneRef,
|
||||
} = $(useUploadMediaAttachment($$(draft)))
|
||||
|
||||
let { shouldExpanded, isExpanded, isSending, isPublishDisabled, publishDraft, failedMessages, preferredLanguage } = $(usePublish(
|
||||
let { shouldExpanded, isExpanded, isSending, isPublishDisabled, publishDraft, failedMessages, preferredLanguage, publishSpoilerText } = $(usePublish(
|
||||
{
|
||||
draftState,
|
||||
...$$({ expanded, isUploading, initialDraft: initial }),
|
||||
|
@ -74,6 +74,8 @@ const characterCount = $computed(() => {
|
|||
}).join(' ').length + 1
|
||||
}
|
||||
|
||||
length += stringLength(publishSpoilerText)
|
||||
|
||||
return length
|
||||
})
|
||||
|
||||
|
@ -162,7 +164,7 @@ defineExpose({
|
|||
|
||||
<div v-if="draft.params.sensitive">
|
||||
<input
|
||||
v-model="draft.params.spoilerText"
|
||||
v-model="publishSpoilerText"
|
||||
type="text"
|
||||
:placeholder="$t('placeholder.content_warning')"
|
||||
p2 border-rounded w-full bg-transparent
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue