diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-10-21 14:15:12 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-10-28 10:26:08 +0100 |
commit | a20f598049bed68db4330ac2571170e1bf51238e (patch) | |
tree | b01a9e1625909d262423851b3212927bd61a9abf /apps/comments/src/components/Comment.vue | |
parent | 510b6533304b254e917d298fbe40a69c4a3f410d (diff) | |
download | nextcloud-server-a20f598049bed68db4330ac2571170e1bf51238e.tar.gz nextcloud-server-a20f598049bed68db4330ac2571170e1bf51238e.zip |
Prevent submitting empty messages
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/comments/src/components/Comment.vue')
-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()) }, }, |