From e0f9c63a54d7a8a4a89483d3cc3202fb637a8bca Mon Sep 17 00:00:00 2001 From: raul Date: Mon, 13 May 2024 13:04:45 +0200 Subject: [PATCH] Reduce latency time for synchronization --- cmd/clientFunc.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/clientFunc.go b/cmd/clientFunc.go index 91fa534..1da0934 100644 --- a/cmd/clientFunc.go +++ b/cmd/clientFunc.go @@ -84,7 +84,7 @@ func Client() { //////////////////////////////////////////////////// func listenMessages(g *gocui.Gui) { - time.Sleep(time.Millisecond * 250) + time.Sleep(time.Millisecond * 50) chatbox, err := g.View("chatbox") if err != nil { log.Panicln(err) @@ -92,7 +92,7 @@ func listenMessages(g *gocui.Gui) { for { messageFromServer, err := receiveMessage(data.Server) if err != nil { - // Avoid triggering an error if client quits the client + // What the hell is this if err == gocui.ErrQuit { g.Close() } else { @@ -254,6 +254,7 @@ func layout(g *gocui.Gui) error { if err != gocui.ErrUnknownView { return err } + chatbox.Autoscroll = true chatbox.Title = "Chat Box (Find source at https://git.bulgariu.xyz/raul/mini-chat!)" }