Skip to content

Commit

Permalink
fix: total stream counter if today not completed
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed Aug 11, 2024
1 parent 2c09036 commit 296c088
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cmd

import (
"fmt"
"strconv"
"strings"

"github.com/charmbracelet/log"
Expand Down Expand Up @@ -157,10 +156,12 @@ func showTodayStreak(c leetcode.Client, cmd *cobra.Command) error {
if err != nil {
return err
}
total := streak.StreakCount
today := ""
if streak.TodayCompleted {
total--
today = config.PassedStyle.Render("+1")
}
cmd.Printf("\nTotal streak: %s%s\n", strconv.Itoa(streak.StreakCount-1), today)
cmd.Printf("\nTotal streak: %d%s\n", total, today)
return nil
}

0 comments on commit 296c088

Please sign in to comment.