perf: goroutinize session.ChannelMessageSend()

This commit is contained in:
rigormorrtiss 2021-08-31 11:06:28 +04:00
parent 6e27a46404
commit 5656faf2e6

View file

@ -83,13 +83,13 @@ func onMessageInputFieldInputCapture(e *tcell.EventKey) *tcell.EventKey {
switch e.Key() {
case tcell.KeyEnter:
if selectedChannel != nil {
text := strings.TrimSpace(messageInputField.GetText())
if text == "" {
t := strings.TrimSpace(messageInputField.GetText())
if t == "" {
return nil
}
session.ChannelMessageSend(selectedChannel.ID, text)
messageInputField.SetText("")
go session.ChannelMessageSend(selectedChannel.ID, t)
}
case tcell.KeyCtrlV:
text, _ := clipboard.ReadAll()