mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-07-06 20:42:33 +02:00
feat: add "flag" toggle in replay & findings
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -72,6 +72,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
m.refreshListViewport()
|
||||
m.refreshBody()
|
||||
}
|
||||
case key.Matches(msg, f.Flag):
|
||||
if len(m.findings) > 0 && m.database != nil {
|
||||
if err := m.database.ToggleFindingFlag(m.findings[m.cursor].ID); err != nil {
|
||||
log.Printf("findings: toggle flag: %v", err)
|
||||
return m, nil
|
||||
}
|
||||
return m, RefreshCmd(m.database)
|
||||
}
|
||||
case key.Matches(msg, f.Dismiss):
|
||||
if len(m.findings) > 0 && m.database != nil {
|
||||
if err := m.database.DismissFinding(m.findings[m.cursor].ID); err != nil {
|
||||
@@ -80,6 +88,14 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
return m, RefreshCmd(m.database)
|
||||
}
|
||||
case key.Matches(msg, f.DismissAll):
|
||||
if m.database != nil {
|
||||
if err := m.database.DismissAllFindings(); err != nil {
|
||||
log.Printf("findings: dismiss all: %v", err)
|
||||
return m, nil
|
||||
}
|
||||
return m, RefreshCmd(m.database)
|
||||
}
|
||||
case key.Matches(msg, g.ScrollUp):
|
||||
util.ScrollViewport(&m.bodyViewport, -1)
|
||||
case key.Matches(msg, g.ScrollDown):
|
||||
|
||||
Reference in New Issue
Block a user