From 5f780287aecedf08f94b6a1e0ae2a8822683a3fc Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Tue, 10 Dec 2024 17:55:10 +0300 Subject: Fix: display and upsert correct roles and icons --- tui.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tui.go') diff --git a/tui.go b/tui.go index fd1946a..9493ffb 100644 --- a/tui.go +++ b/tui.go @@ -92,7 +92,6 @@ func startNewChat() { chatMap[newChat.Name] = newChat updateStatusLine() colorText() - return } func init() { @@ -313,7 +312,10 @@ func init() { textView.SetText(chatToText(cfg.ShowSys)) colorText() textView.ScrollToEnd() - initSysCards() + _, err = initSysCards() + if err != nil { + logger.Error("failed to init sys cards", "error", err) + } app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { if event.Key() == tcell.KeyF1 { chatList, err := loadHistoryChats() @@ -400,7 +402,9 @@ func init() { logger.Error("failed to export chat;", "error", err, "chat_name", activeChatName) return nil } - notifyUser("exported chat", "chat: "+activeChatName+" was exported") + if err := notifyUser("exported chat", "chat: "+activeChatName+" was exported"); err != nil { + logger.Error("failed to send notification", "error", err) + } return nil } if event.Key() == tcell.KeyCtrlA { @@ -442,7 +446,7 @@ func init() { nl = "" } if msgText != "" { - fmt.Fprintf(textView, "%s[-:-:u](%d) <%s>: [-:-:-]\n%s\n", + fmt.Fprintf(textView, "%s[-:-:b](%d) <%s>: [-:-:-]\n%s\n", nl, len(chatBody.Messages), cfg.UserRole, msgText) textArea.SetText("", true) textView.ScrollToEnd() -- cgit v1.2.3