MCPcopy Create free account
hub / github.com/dailydotdev/apps / getQuestClaimableSnapshots

Function getQuestClaimableSnapshots

packages/shared/src/hooks/useQuestUpdates.ts:24–51  ·  view source on GitHub ↗
(
  dashboard?: QuestDashboard,
)

Source from the content-addressed store, hash-verified

22};
23
24const getQuestClaimableSnapshots = (
25 dashboard?: QuestDashboard,
26): Map<string, ClaimableQuestSnapshot> => {
27 const snapshots = new Map<string, ClaimableQuestSnapshot>();
28
29 if (!dashboard) {
30 return snapshots;
31 }
32
33 [
34 ...dashboard.daily.regular,
35 ...dashboard.daily.plus,
36 ...dashboard.weekly.regular,
37 ...dashboard.weekly.plus,
38 ...dashboard.milestone,
39 ].forEach((quest) => {
40 snapshots.set(quest.rotationId, {
41 rotationId: quest.rotationId,
42 questId: quest.quest.id,
43 questType: quest.quest.type,
44 userQuestId: quest.userQuestId ?? null,
45 locked: quest.locked,
46 claimable: quest.claimable,
47 });
48 });
49
50 return snapshots;
51};
52
53// Keeps the quest dashboard cache in sync with server-side quest progress.
54//

Callers 1

useQuestUpdatesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected