Dismiss function

This commit is contained in:
2026-05-11 06:57:07 -06:00
parent d4cc41df63
commit c48ee22f99
3 changed files with 119 additions and 7 deletions
+8 -1
View File
@@ -102,6 +102,7 @@ func main() {
}
postsPath := filepath.Join(cfgDir, "posts.json")
dismissedPath := filepath.Join(cfgDir, "dismissed.json")
st, err := state.Load(statePath)
if err != nil {
@@ -115,6 +116,12 @@ func main() {
ps, _ = store.Load(postsPath)
}
ds, err := store.LoadDismissed(dismissedPath)
if err != nil {
fmt.Fprintf(os.Stderr, "Warning: could not load dismissed file: %v\n", err)
ds, _ = store.LoadDismissed(dismissedPath)
}
// Build API clients — nil if credentials are missing
var twClient *twitter.Client
if cfg.HasTwitterRead() {
@@ -166,7 +173,7 @@ func main() {
)
}
model := ui.New(cfg, st, ps, f, cl, poster, liPoster)
model := ui.New(cfg, st, ps, ds, f, cl, poster, liPoster)
p := tea.NewProgram(model, tea.WithAltScreen(), tea.WithMouseCellMotion())
if _, err := p.Run(); err != nil {