Skip to content

Commit 6d328ad

Browse files
authored
Disable streak counter for us site (#382)
1 parent 4bf6465 commit 6d328ad

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

cmd/submit.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cmd
22

33
import (
4+
"errors"
45
"fmt"
56
"strings"
67

@@ -153,6 +154,9 @@ func appendToTestCases(q *leetcode.QuestionData, result *leetcode.SubmitCheckRes
153154

154155
func showTodayStreak(c leetcode.Client, cmd *cobra.Command) error {
155156
streak, err := c.GetStreakCounter()
157+
if errors.Is(err, errors.ErrUnsupported) {
158+
return nil
159+
}
156160
if err != nil {
157161
return err
158162
}

leetcode/client_us.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,3 +361,7 @@ func (c *usClient) GetQuestionTags() ([]QuestionTag, error) {
361361
}
362362
return tags, nil
363363
}
364+
365+
func (c *usClient) GetStreakCounter() (StreakCounter, error) {
366+
return StreakCounter{}, errors.ErrUnsupported
367+
}

0 commit comments

Comments
 (0)