diff options
author | Grail Finder <wohilas@gmail.com> | 2025-08-07 06:43:02 +0300 |
---|---|---|
committer | Grail Finder <wohilas@gmail.com> | 2025-08-07 06:43:02 +0300 |
commit | c58f251745a6dce587aad07d4d25d9520a863a59 (patch) | |
tree | 3689fa3bc8f599dd8971915a9df6d52d0f214440 /tui.go | |
parent | 39e8f557cf043d1f1004bbf925330b2a7f264bfc (diff) |
Enha: export chat to export dir
Diffstat (limited to 'tui.go')
-rw-r--r-- | tui.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -42,6 +42,7 @@ var ( propsPage = "propsPage" codeBlockPage = "codeBlockPage" imgPage = "imgPage" + exportDir = "chat_exports" // help text helpText = ` [yellow]Esc[white]: send msg @@ -618,19 +619,19 @@ func init() { } if event.Key() == tcell.KeyF11 { // read files in chat_exports - dirname := "chat_exports" - filelist, err := os.ReadDir(dirname) + filelist, err := os.ReadDir(exportDir) if err != nil { if err := notifyUser("failed to load exports", err.Error()); err != nil { logger.Error("failed to send notification", "error", err) } + return nil } fli := []string{} for _, f := range filelist { if f.IsDir() || !strings.HasSuffix(f.Name(), ".json") { continue } - fpath := path.Join(dirname, f.Name()) + fpath := path.Join(exportDir, f.Name()) fli = append(fli, fpath) } // check error |