fixed bug where task fill doesn't persist

This commit is contained in:
boofnet
2022-04-07 22:46:29 -04:00
parent 84b494a6b8
commit 508e758886
+6 -2
View File
@@ -1,7 +1,7 @@
// ============================================================================= // =============================================================================
// Auth: Alex Celani // Auth: Alex Celani
// File: tdm.go // File: tdm.go
// Revn: 03-29-2022 3.0 // Revn: 04-07-2022 3.1
// //
// Func: display and manage progress of a litany of items to be done, // Func: display and manage progress of a litany of items to be done,
// with an organization scheme similar to Trello. It's CLI // with an organization scheme similar to Trello. It's CLI
@@ -110,6 +110,8 @@
// name of length 1 // name of length 1
//*03-29-2022: added, tested, and commented function for catching //*03-29-2022: added, tested, and commented function for catching
// keyboard interrupts // keyboard interrupts
// 04-07-2022: fixed bug where task fill did not persist when task
// contained subtasks
// //
// ============================================================================= // =============================================================================
@@ -393,6 +395,7 @@ func fileIn() {
} }
// separate task from fill // separate task from fill
tContents := split( tTasks[b], "," ) tContents := split( tTasks[b], "," )
// if there is no fill, interpret this as 0 fill // if there is no fill, interpret this as 0 fill
if len( tContents[1] ) == 0 { if len( tContents[1] ) == 0 {
// inferred fill is a string, so it can be processed // inferred fill is a string, so it can be processed
@@ -400,7 +403,8 @@ func fileIn() {
tContents[1] = "0" tContents[1] = "0"
} }
tk.name = tContents[0] // set name of task tk.name = tContents[0] // set name of task
fil, _ := atoi( tContents[1] ) // convert fill to int // convert fill to int
fil, _ := atoi( split( tContents[1], ":" )[0] )
tk.fill = fil // set fill of task tk.fill = fil // set fill of task
tasks = append( tasks, tk ) // add task to task array tasks = append( tasks, tk ) // add task to task array