From 296c088a4738c665e01ba1413118ad3993d07bd4 Mon Sep 17 00:00:00 2001 From: j178 <10510431+j178@users.noreply.github.com> Date: Sun, 11 Aug 2024 14:07:56 +0800 Subject: [PATCH] fix: total stream counter if today not completed --- cmd/submit.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/submit.go b/cmd/submit.go index f46cb9e..cae1cbb 100644 --- a/cmd/submit.go +++ b/cmd/submit.go @@ -2,7 +2,6 @@ package cmd import ( "fmt" - "strconv" "strings" "github.com/charmbracelet/log" @@ -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 }