From f51559a5e3d3cb2ae4ced7531f0a050124c90373 Mon Sep 17 00:00:00 2001 From: Brett <27568879+BrettCleary@users.noreply.github.com> Date: Wed, 23 Oct 2024 00:55:21 -0700 Subject: [PATCH] bump (#27) --- package.json | 2 +- src/components/QuestDetailsWrapper/index.tsx | 6 ++++++ src/helpers/getQueryKeys.ts | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 162ebe8..538ca34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hyperplay/quests-ui", - "version": "0.0.31", + "version": "0.0.32", "description": "", "main": "index.js", "scripts": { diff --git a/src/components/QuestDetailsWrapper/index.tsx b/src/components/QuestDetailsWrapper/index.tsx index f00b5b5..35975b4 100644 --- a/src/components/QuestDetailsWrapper/index.tsx +++ b/src/components/QuestDetailsWrapper/index.tsx @@ -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 @@ -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) { diff --git a/src/helpers/getQueryKeys.ts b/src/helpers/getQueryKeys.ts index 189c003..d274388 100644 --- a/src/helpers/getQueryKeys.ts +++ b/src/helpers/getQueryKeys.ts @@ -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] +}