diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-10-21 15:15:12 +0300 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-10-28 12:26:08 +0300 |
commit | a20f598049bed68db4330ac2571170e1bf51238e (patch) | |
tree | b01a9e1625909d262423851b3212927bd61a9abf /apps/comments/src | |
parent | 510b6533304b254e917d298fbe40a69c4a3f410d (diff) |
Prevent submitting empty messages
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/comments/src')
-rw-r--r-- | apps/comments/src/components/Comment.vue | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/comments/src/components/Comment.vue b/apps/comments/src/components/Comment.vue index edcaeafb7b6..d90d5a7fb6a 100644 --- a/apps/comments/src/components/Comment.vue +++ b/apps/comments/src/components/Comment.vue @@ -215,11 +215,16 @@ export default { * Dispatch message between edit and create */ onSubmit() { + // Do not submit if message is empty + if (this.localMessage.trim() === '') { + return + } + if (this.editor) { - this.onNewComment(this.localMessage) + this.onNewComment(this.localMessage.trim()) return } - this.onEditComment(this.localMessage) + this.onEditComment(this.localMessage.trim()) }, }, |