Skip to content

Commit

Permalink
bump (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrettCleary authored Oct 23, 2024
1 parent 096d4a1 commit f51559a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperplay/quests-ui",
"version": "0.0.31",
"version": "0.0.32",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions src/components/QuestDetailsWrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { TrackEventFn } from '@/types/analytics'
import { TFunction } from 'i18next'
import cn from 'classnames'
import { useHasPendingExternalSync } from '@/hooks/useHasPendingExternalSync'
import { getGetQuestLogInfoQueryKey } from '@/helpers/getQueryKeys'

class ClaimError extends Error {
properties: any
Expand Down Expand Up @@ -525,6 +526,11 @@ export function QuestDetailsWrapper({
},
onSuccess: async () => {
await questPlayStreakResult.invalidateQuery()
if (selectedQuestId !== null) {
await queryClient.invalidateQueries({
queryKey: [getGetQuestLogInfoQueryKey(selectedQuestId.toString())]
})
}
},
onError: (error) => {
if (error instanceof ClaimError) {
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/getQueryKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ export function getGetUserPlayStreakQueryKey(questId: number | null) {
export function getSyncPlaysessionQueryKey(projectId: string) {
return ['syncPlaysession', projectId]
}

export function getGetQuestLogInfoQueryKey(questId: string) {
return ['getQuestLogInfo', questId]
}

0 comments on commit f51559a

Please sign in to comment.