summaryrefslogtreecommitdiff
path: root/tui.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-08-07 06:43:02 +0300
committerGrail Finder <wohilas@gmail.com>2025-08-07 06:43:02 +0300
commitc58f251745a6dce587aad07d4d25d9520a863a59 (patch)
tree3689fa3bc8f599dd8971915a9df6d52d0f214440 /tui.go
parent39e8f557cf043d1f1004bbf925330b2a7f264bfc (diff)
Enha: export chat to export dir
Diffstat (limited to 'tui.go')
-rw-r--r--tui.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/tui.go b/tui.go
index 0dab6f0..b563797 100644
--- a/tui.go
+++ b/tui.go
@@ -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