File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ class ChallengesService {
325
325
* @return {Promise } Resolves to the challenge object.
326
326
*/
327
327
async getChallengeDetails ( challengeId ) {
328
- const user = decodeToken ( this . private . tokenV3 ) ;
328
+ const memberId = this . private . tokenV3 ? decodeToken ( this . private . tokenV3 ) . userId : null ;
329
329
let challenge = { } ;
330
330
let isLegacyChallenge = false ;
331
331
let isRegistered = false ;
@@ -347,8 +347,8 @@ class ChallengesService {
347
347
challenge . registrants = [ ] ;
348
348
}
349
349
350
- if ( user ) {
351
- const userChallenges = await this . private . apiV5 . get ( `/resources/${ user . userId } /challenges` )
350
+ if ( memberId ) {
351
+ const userChallenges = await this . private . apiV5 . get ( `/resources/${ memberId } /challenges` )
352
352
. then ( checkErrorV5 ) . then ( res => res . result ) ;
353
353
isRegistered = _ . includes ( userChallenges , challengeId ) ;
354
354
}
You can’t perform that action at this time.
0 commit comments