mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 12:07:23 +00:00
Messages loading in proper order
This commit is contained in:
4
main.go
4
main.go
@ -41,6 +41,7 @@ func populateChat(g *gocui.Gui) {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
} else {
|
} else {
|
||||||
var printMe []string
|
var printMe []string
|
||||||
|
var actuallyPrintMe string
|
||||||
for _, message := range api.Result.Messages {
|
for _, message := range api.Result.Messages {
|
||||||
if message.Msg.Content.Type == "text" {
|
if message.Msg.Content.Type == "text" {
|
||||||
msgSender := message.Msg.Sender.Username
|
msgSender := message.Msg.Sender.Username
|
||||||
@ -50,8 +51,9 @@ func populateChat(g *gocui.Gui) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i := len(printMe) - 1; i >= 0; i-- {
|
for i := len(printMe) - 1; i >= 0; i-- {
|
||||||
printToView(g, "Chat", printMe[i])
|
actuallyPrintMe += printMe[i] + "\n"
|
||||||
}
|
}
|
||||||
|
printToView(g, "Chat", actuallyPrintMe)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user