Reduce latency time for synchronization

This commit is contained in:
raul 2024-05-13 13:04:45 +02:00
parent 940d1287ec
commit e0f9c63a54
1 changed files with 3 additions and 2 deletions

View File

@ -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!)"
}