Skip to content

Commit c640219

Browse files
authored
fix: prevent user from sending empty messages (#135)
1 parent 6f72e7a commit c640219

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/Sendbox.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ export default {
7979
await this.postFile(this.file)
8080
return
8181
}
82+
if (this.composingMessage.trim() === '') {
83+
// do not send empty messages
84+
return
85+
}
8286
await this.$xmpp.sendMessage(this.activeChat, this.composingMessage, this.isRoom)
8387
this.composingMessage = ''
8488
} catch (error) {

0 commit comments

Comments
 (0)