@@ -352,7 +352,11 @@ export const ProfileHeader = ({
352352 const handleProfileBack = ( ) => {
353353 try {
354354 if ( process . env . REACT_APP_IS_APP_IFRAME === "true" ) {
355- window . parent . postMessage ( { type : "restore-iframe-content" } , window ?. location ?. ancestorOrigins ?. [ 0 ] || window . parent . location . origin ) ;
355+ window . parent . postMessage (
356+ { type : "restore-iframe-content" } ,
357+ window ?. location ?. ancestorOrigins ?. [ 0 ] ||
358+ window . parent . location . origin
359+ ) ;
356360 navigate ( "/" ) ;
357361 } else {
358362 navigate ( "/discover-start" ) ;
@@ -572,14 +576,14 @@ const Assesment = ({ discoverStart }) => {
572576 dispatch ( setVirtualId ( localStorage . getItem ( "virtualId" ) ) ) ;
573577 let contentSessionId = localStorage . getItem ( "contentSessionId" ) ;
574578 localStorage . setItem ( "sessionId" , contentSessionId ) ;
575- const TOKEN = localStorage . getItem ( "apiToken" ) ;
576- let virtualId ;
577- if ( TOKEN ) {
578- const tokenDetails = jwtDecode ( TOKEN ) ;
579- virtualId = tokenDetails ?. virtual_id ;
580- }
579+ // const TOKEN = localStorage.getItem("apiToken");
580+ // let virtualId;
581+ // if (TOKEN) {
582+ // const tokenDetails = jwtDecode(TOKEN);
583+ // virtualId = tokenDetails?.virtual_id;
584+ // }
581585
582- if ( discoverStart && username && ! virtualId ) {
586+ if ( discoverStart && username && ! TOKEN ) {
583587 ( async ( ) => {
584588 setLocalData ( "profileName" , username ) ;
585589 const usernameDetails = await fetchVirtualId ( username ) ;
@@ -612,7 +616,7 @@ const Assesment = ({ discoverStart }) => {
612616 } ) ;
613617 }
614618
615- dispatch ( setVirtualId ( virtualId ) ) ;
619+ // dispatch(setVirtualId(virtualId));
616620 } ) ( ) ;
617621 } else {
618622 ( async ( ) => {
@@ -634,7 +638,7 @@ const Assesment = ({ discoverStart }) => {
634638
635639 if (
636640 process . env . REACT_APP_IS_APP_IFRAME !== "true" &&
637- virtualId &&
641+ TOKEN &&
638642 localStorage . getItem ( "contentSessionId" ) !== null
639643 ) {
640644 fetchUserPoints ( )
@@ -652,10 +656,10 @@ const Assesment = ({ discoverStart }) => {
652656
653657 const TOKEN = localStorage . getItem ( "apiToken" ) ;
654658 let virtualId ;
655- if ( TOKEN ) {
656- const tokenDetails = jwtDecode ( TOKEN ) ;
657- virtualId = JSON . stringify ( tokenDetails ?. virtual_id ) ;
658- }
659+ // if (TOKEN) {
660+ // const tokenDetails = jwtDecode(TOKEN);
661+ // virtualId = JSON.stringify(tokenDetails?.virtual_id);
662+ // }
659663
660664 const handleOpenVideo = ( ) => {
661665 if ( process . env . REACT_APP_SHOW_HELP_VIDEO === "true" ) {
@@ -694,7 +698,7 @@ const Assesment = ({ discoverStart }) => {
694698 const navigate = useNavigate ( ) ;
695699 const handleRedirect = ( ) => {
696700 const profileName = getLocalData ( "profileName" ) ;
697- if ( ! username && ! profileName && ! virtualId && level === 0 ) {
701+ if ( ! username && ! profileName && ! TOKEN && level === 0 ) {
698702 // alert("please add username in query param");
699703 setOpenMessageDialog ( {
700704 message : "please add username in query param" ,
0 commit comments