1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-22 07:37:23 +00:00

Messages loading in proper order

This commit is contained in:
2019-09-18 19:52:50 -04:00
parent b108347ffa
commit 7c87d911ee

View File

@ -41,6 +41,7 @@ func populateChat(g *gocui.Gui) {
log.Fatal(err)
} else {
var printMe []string
var actuallyPrintMe string
for _, message := range api.Result.Messages {
if message.Msg.Content.Type == "text" {
msgSender := message.Msg.Sender.Username
@ -50,8 +51,9 @@ func populateChat(g *gocui.Gui) {
}
}
for i := len(printMe) - 1; i >= 0; i-- {
printToView(g, "Chat", printMe[i])
actuallyPrintMe += printMe[i] + "\n"
}
printToView(g, "Chat", actuallyPrintMe)
}
}