mirror of
https://codeberg.org/scip/anydb.git
synced 2025-12-17 20:41:00 +01:00
fixed list items
This commit is contained in:
@@ -2,6 +2,7 @@ package ui
|
||||
|
||||
import (
|
||||
"log"
|
||||
"log/slog"
|
||||
|
||||
"github.com/charmbracelet/bubbles/key"
|
||||
"github.com/charmbracelet/bubbles/list"
|
||||
@@ -16,9 +17,11 @@ func newItemDelegate(keys *delegateKeyMap, config *cfg.Config) list.DefaultDeleg
|
||||
d.UpdateFunc = func(msg tea.Msg, m *list.Model) tea.Cmd {
|
||||
var title string
|
||||
|
||||
if entry, ok := m.SelectedItem().(app.DbEntry); ok {
|
||||
if entry, ok := m.SelectedItem().(item); ok {
|
||||
title = entry.Title()
|
||||
slog.Debug("active entry", "entry", title)
|
||||
} else {
|
||||
slog.Debug("no active entry")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user