()
| 43 | } |
| 44 | |
| 45 | function markActiveDay() { |
| 46 | const now = today() |
| 47 | |
| 48 | if (state.lastActiveDay === now) { |
| 49 | return |
| 50 | } |
| 51 | |
| 52 | if (!state.lastActiveDay) { |
| 53 | state.currentStreak = 1 |
| 54 | } |
| 55 | else { |
| 56 | const diff = dayDiff(state.lastActiveDay, now) |
| 57 | state.currentStreak = diff === 1 ? state.currentStreak + 1 : 1 |
| 58 | } |
| 59 | |
| 60 | state.lastActiveDay = now |
| 61 | } |
| 62 | |
| 63 | function markCopyMilestoneShown(space: CopySpace, milestone: number) { |
| 64 | state.lastShownCopyMilestones[space] = milestone |
no test coverage detected