getting somewhere

This commit is contained in:
june 2025-03-10 17:34:05 +13:00
parent 254d74bdb4
commit b38412a86e
Signed by untrusted user who does not match committer: breadone
GPG Key ID: FDC19FE143200483

View File

@ -68,7 +68,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case "enter":
if m.addTask {
AddNewTask(m)
AddNewTask(&m)
m.addTask = false
m.textinput.Reset()
}
@ -91,7 +91,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, cmd
}
func AddNewTask(m model) {
func AddNewTask(m *model) {
t := todo{
name: m.textinput.Value(),
done: false,
@ -106,15 +106,15 @@ func AddNewTask(m model) {
func (m model) View() string {
// The header
s := ""
currentList := []todo{}
currentList := m.todos
s += "GOTD\n"
switch m.tab {
case 0:
s += "Inbox"
inboxFilter := func(t todo) bool { return t.isInbox }
currentList = filter(m.todos, inboxFilter)
// inboxFilter := func(t todo) bool { return t.isInbox }
// currentList = filter(m.todos, inboxFilter)
case 1:
s += "Today"
case 2: