MatheusrdSantos / vue-quick-chat

A simple chat component created with Vue.js
MIT License
128 stars 45 forks source link

A message adds after cliking on enter even if its empty #42

Closed savayer closed 3 years ago

savayer commented 3 years ago

I tried

async onMessageSubmit (message) {
  message.content = message.content.trim().replace(/\r\n/g, '')
  if (message.content === '') {
    return
  }
  ...

but empty message still adds it seems newMessage mutation should have some condition

can you fix it? Or is there a way how can i avoid it?

MatheusrdSantos commented 3 years ago

Hi, @savayer. I'll fix it tomorrow. Probably I forgot to check the message content.

MatheusrdSantos commented 3 years ago

Hi, @savayer. It's fixed now 962b2d146faba6cdfdefc205724c9d01ed05e621. Just update to version 1.2.6. Thanks for your report :)

savayer commented 3 years ago

Great, thanks!