Skip to content

Commit

Permalink
Add: Quit in anime selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Wraient committed Oct 26, 2024
1 parent 0d0854a commit ab92766
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/curd.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ func SetupCurd(userCurdConfig *CurdConfig, anime *Anime, user *User, databaseAni
ExitCurd(fmt.Errorf("Error selecting anime"))
}

if anilistSelectedOption.Key == "-1" || anilistSelectedOption.Label == "quit" {
ExitCurd(fmt.Errorf("Quit"))
if anilistSelectedOption.Key == "-1" {
ExitCurd(nil)
}

if anilistSelectedOption.Label == "add_new" {
Expand Down
4 changes: 4 additions & 0 deletions internal/selection_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ func (m *Model) filterOptions() {
Key: "add_new",
})
}
m.filteredKeys = append(m.filteredKeys, SelectionOption{
Label: "Quit",
Key: "-1",
})
}

// DynamicSelect displays a simple selection prompt without extra features
Expand Down

0 comments on commit ab92766

Please sign in to comment.