Skip to content
Snippets Groups Projects
Commit 6f668df6 authored by lain's avatar lain
Browse files

Count spoiler text in the character count. Fixes #135.

parent 2f11ec29
No related branches found
No related tags found
1 merge request!371Resolve "PleromaFE does not count the Content Warning into Post length"
Pipeline #
......@@ -53,7 +53,7 @@ const PostStatusForm = {
posting: false,
highlighted: 0,
newStatus: {
spoilerText: this.subject,
spoilerText: this.subject || '',
status: statusText,
contentType: 'text/plain',
nsfw: false,
......@@ -128,6 +128,9 @@ const PostStatusForm = {
statusLength () {
return this.newStatus.status.length
},
spoilerTextLength () {
return this.newStatus.spoilerText.length
},
statusLengthLimit () {
return this.$store.state.instance.textlimit
},
......@@ -135,10 +138,10 @@ const PostStatusForm = {
return this.statusLengthLimit > 0
},
charactersLeft () {
return this.statusLengthLimit - this.statusLength
return this.statusLengthLimit - (this.statusLength + this.spoilerTextLength)
},
isOverLengthLimit () {
return this.hasStatusLengthLimit && (this.statusLength > this.statusLengthLimit)
return this.hasStatusLengthLimit && (this.charactersLeft < 0)
},
scopeOptionsEnabled () {
return this.$store.state.instance.scopeOptionsEnabled
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment