Updated TimerList struct

This commit is contained in:
2023-01-12 06:04:17 -06:00
parent c98a4dea0c
commit c412f54294
10 changed files with 260 additions and 27 deletions

View File

@@ -42,8 +42,9 @@ func opMod(cmd *cobra.Command, args []string) error {
id, err := strconv.Atoi(args[0])
if err != nil {
// We didn't have a timer id, so try to modify the first active timer
if len(*p.TimerList.GetActiveTimers()) > 0 {
timer = (*p.TimerList.GetActiveTimers())[0]
active := p.TimerList.GetActiveTimers().GetTimerSlice()
if len(active) > 0 {
timer = active[0]
} else {
// And we don't have any active timers
return fmt.Errorf("No active timers, 'id' must be provided: %w", err)