Skip to content

Commit 31edd70

Browse files
fix(quest): only apply requirement filter for completed quests (#1326)
* fix(quest): only apply requirement filter for completed quests * chore: bump --------- Co-authored-by: Brett <27568879+BrettCleary@users.noreply.github.com>
1 parent 9561080 commit 31edd70

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/frontend/hooks/useGetQuests.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@ export default function useGetQuests(projectId?: string) {
3838
* In these cases, the user can no longer earn a reward or claim a reward.
3939
*/
4040
if (isSignedIn && !isGetQuestStatesPending && quests) {
41-
quests = quests.filter(
42-
(quest_i) =>
41+
quests = quests.filter((quest_i) => {
42+
if (quest_i.status !== 'COMPLETED') {
43+
return true
44+
}
45+
46+
// this means we detected that the user has met the eligibility requirements
47+
return (
4348
Object.hasOwn(questIdToQuestStateMap, quest_i.id) &&
4449
questIdToQuestStateMap[quest_i.id]
45-
)
50+
)
51+
})
4652
}
4753

4854
/**

0 commit comments

Comments
 (0)