MCPcopy Create free account
hub / github.com/massCodeIO/massCode / markActiveDay

Function markActiveDay

src/renderer/composables/useDonations.ts:45–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43}
44
45function 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
63function markCopyMilestoneShown(space: CopySpace, milestone: number) {
64 state.lastShownCopyMilestones[space] = milestone

Callers 4

useActivityTrackerFunction · 0.85
incrementCopyFunction · 0.85
incrementCreatedFunction · 0.85
incrementSentFunction · 0.85

Calls 2

todayFunction · 0.85
dayDiffFunction · 0.85

Tested by

no test coverage detected