From b57da10e27744e1effe0bdedfb5e715c45e7ff98 Mon Sep 17 00:00:00 2001 From: Pavel Alexandrov Date: Sat, 11 May 2024 17:09:52 +0300 Subject: [PATCH] Fix #437 (#458) --- components/candle/challengeService.ts | 5 +++-- components/types/types.ts | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/components/candle/challengeService.ts b/components/candle/challengeService.ts index 86e4e4f9..ad7818a3 100644 --- a/components/candle/challengeService.ts +++ b/components/candle/challengeService.ts @@ -194,6 +194,7 @@ export abstract class ChallengeRegistry { ): void { const gameChallenges = this.groupContents[gameVersion] challenge.inGroup = groupId + challenge.inLocation = location this.challenges[gameVersion].set(challenge.Id, challenge) if (!gameChallenges.has(location)) { @@ -244,7 +245,7 @@ export abstract class ChallengeRegistry { return ( this.challenges[gameVersion].delete(challengeId) && this.groupContents[gameVersion] - .get(challenge.ParentLocationId)! + .get(challenge.inLocation!)! .get(challenge.inGroup!)! .delete(challengeId) ) @@ -1243,7 +1244,7 @@ export class ChallengeService extends ChallengeRegistry { const groupData = this.getGroupByIdLoc( groupId, - challenges[0].ParentLocationId, + challenges[0].inLocation!, gameVersion, ) diff --git a/components/types/types.ts b/components/types/types.ts index 1e02f49e..30259454 100644 --- a/components/types/types.ts +++ b/components/types/types.ts @@ -1378,9 +1378,19 @@ export interface RegistryChallenge extends SavedChallenge { /** * Warning: this property is INTERNAL and should NOT BE SPECIFIED by API users. * + * The parent challenge group this challenge belongs to. + * * @internal */ inGroup?: string + /** + * Warning: this property is INTERNAL and should NOT BE SPECIFIED by API users. + * + * The location ID this challenge belongs to, may mismatch ParentLocationId field. + * + * @internal + */ + inLocation?: string } /**