Skip to content

Commit c873690

Browse files
authored
Merge pull request #551 from swfz/feature/tmp-support-current-streak
fix: 365日以上のstreakの場合の文言を設定
2 parents ccebfae + dba604d commit c873690

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pages/kusa/[username].tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export const getServerSideProps = async (
3131
.map((c: { contributionCount: number }) => c.contributionCount);
3232

3333
const [todayContributionCount, yesterdayContributionCount] = contributions;
34-
const currentStreak = todayContributionCount > 0 ? contributions.indexOf(0) : contributions.slice(1).indexOf(0);
34+
35+
const streak = todayContributionCount > 0 ? contributions.indexOf(0) : contributions.slice(1).indexOf(0);
36+
const currentStreak = streak < 0 ? '365+' : streak;
3537

3638
return { props: { username, todayContributionCount, yesterdayContributionCount, currentStreak } };
3739
};

0 commit comments

Comments
 (0)