From 3500b44b2f3c793315e75526bc69cf8f20d18ad2 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Tue, 27 May 2025 11:19:01 +0300 Subject: Fix: update status line panic --- tui.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tui.go b/tui.go index 43df360..df300bb 100644 --- a/tui.go +++ b/tui.go @@ -1,10 +1,10 @@ package main import ( + "fmt" "gf-lt/extra" "gf-lt/models" "gf-lt/pngmeta" - "fmt" "image" _ "image/jpeg" _ "image/png" @@ -140,7 +140,11 @@ func colorText() { } func updateStatusLine() { - position.SetText(fmt.Sprintf(indexLine, botRespMode, cfg.AssistantRole, activeChatName, cfg.RAGEnabled, cfg.ToolUse, chatBody.Model, cfg.CurrentAPI, cfg.ThinkUse, logLevel.Level(), asr.IsRecording())) + isRecording := false + if asr != nil { + isRecording = asr.IsRecording() + } + position.SetText(fmt.Sprintf(indexLine, botRespMode, cfg.AssistantRole, activeChatName, cfg.RAGEnabled, cfg.ToolUse, chatBody.Model, cfg.CurrentAPI, cfg.ThinkUse, logLevel.Level(), isRecording)) } func initSysCards() ([]string, error) { -- cgit v1.2.3