From bd0da056a9f4c1246ad5a980b1c824b7382478cf Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 3 Jul 2022 22:57:06 +0530 Subject: dynamically handling prompt length, search length, offset, etc --- ui/actions.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'ui/actions.go') diff --git a/ui/actions.go b/ui/actions.go index b6bbf16..7831fe4 100644 --- a/ui/actions.go +++ b/ui/actions.go @@ -41,9 +41,6 @@ type MangaAction struct { } func AnimeActionMenu(animeIsAdded bool) func(a.Anime) { - // TODO: load promptLength from config - promptLength := 5 - options := []AnimeAction { {"Set Status", "Set status for an anime (watching, dropped, etc)", AnimeStatusMenu}, {"Set Episodes", "Set number of episodes watched", EpisodeInput}, @@ -83,7 +80,7 @@ func AnimeActionMenu(animeIsAdded bool) func(a.Anime) { Items: options, Templates: template, Searcher: searcher, - Size: promptLength, + Size: PromptLength, } res, _, err := prompt.Run() @@ -96,9 +93,6 @@ func AnimeActionMenu(animeIsAdded bool) func(a.Anime) { } func MangaActionMenu(mangaIsAdded bool) func(m.Manga) { - // TODO: load promptLength from config - promptLength := 5 - options := []MangaAction { {"Set Status", "Set status for a manga (reading, dropped, etc)", MangaStatusMenu}, {"Set Chapters", "Set number of chapters read", ChapterInput}, @@ -138,7 +132,7 @@ func MangaActionMenu(mangaIsAdded bool) func(m.Manga) { Items: options, Templates: template, Searcher: searcher, - Size: promptLength, + Size: PromptLength, } res, _, err := prompt.Run() -- cgit v1.2.3