From 5d5df5a089b16b56026d831136362baeb97637ec Mon Sep 17 00:00:00 2001 From: joop Date: Sat, 2 Apr 2022 05:27:07 +0100 Subject: Bugfix for display issue with adding codes to the list when skipping --- main.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index 5039c0a..10a72b1 100644 --- a/main.go +++ b/main.go @@ -377,20 +377,17 @@ func main() { } } } - // Add the code to CodeList - CodeList[prayer.Id] = code - fmt.Println("Added code ", code, " to prayer ", prayer.Id) + if code != "" { + // If the code is not empty, add it to the code list + // and write the code list to CodeList.csv + CodeList[prayer.Id] = code + WriteCodeList(CodeList) + } // Ask if the user wants to identify another prayer // or if they want to quit - // To identify another prayer, continue - // To quit, save the CodeList and quit fmt.Print("Identify another prayer? (y/n) ") answer := prompt.MustRead[string]() if answer == "n" { - err = WriteCodeList(CodeList) - if err != nil { - panic(err) - } break } } -- cgit v1.2.3-70-g09d2