Limit status message to 500 chars

Signed-off-by: Louis Chemineau <louis@chmn.me>
pull/1744/head
Louis Chemineau 2023-04-20 10:14:35 +02:00
rodzic aa05d640f4
commit 6879d1cd72
1 zmienionych plików z 18 dodań i 2 usunięć

Wyświetl plik

@ -68,7 +68,7 @@
:contenteditable="!loading"
class="message"
placeholder="What would you like to share?"
:class="{'icon-loading': loading}"
:class="{'icon-loading': loading, 'too-long': statusIsTooLong}"
@keyup.prevent.enter="keyup"
@input="updateStatusContent"
@tribute-replaced="updatePostFromTribute" />
@ -277,12 +277,24 @@ export default {
return true
}
return !this.statusIsEmpty
if (this.statusIsTooLong) {
return false
}
if (this.statusIsEmpty) {
return false
}
return true
},
/** @return {boolean} */
statusIsEmpty() {
return this.statusContent.length === 0 || this.statusContent === '<br>'
},
statusIsTooLong() {
return this.statusContent.length > 500
},
},
mounted() {
this.$root.$on('composer-reply', (/** @type {import('../../types/Mastodon.js').Status} */data) => {
@ -518,6 +530,10 @@ export default {
min-width: 2px;
display: block;
&.too-long {
color: var(--color-error);
}
:deep(.mention) {
color: var(--color-primary-element);
background-color: var(--color-background-dark);