@@ -41,6 +41,7 @@ import DefaultSignature from "../components/pdf/DefaultSignature";
41
41
import ModalUi from "../primitives/ModalUi" ;
42
42
import VerifyEmail from "../components/pdf/VerifyEmail" ;
43
43
import TourContentWithBtn from "../primitives/TourContentWithBtn" ;
44
+ import { appInfo } from "../constant/appinfo" ;
44
45
function useQuery ( ) {
45
46
return new URLSearchParams ( useLocation ( ) . search ) ;
46
47
}
@@ -164,18 +165,26 @@ function PdfRequestFiles() {
164
165
const handleResend = async ( e ) => {
165
166
e . preventDefault ( ) ;
166
167
setOtpLoader ( true ) ;
167
- await handleSendOTP ( Parse . User . current ( ) . getEmail ( ) ) ;
168
+ const localuser = localStorage . getItem (
169
+ `Parse/${ appInfo . appId } /currentUser`
170
+ ) ;
171
+ const currentUser = JSON . parse ( JSON . stringify ( localuser ) ) ;
172
+ await handleSendOTP ( currentUser ?. email ) ;
168
173
setOtpLoader ( false ) ;
169
174
alert ( "OTP sent on you email" ) ;
170
175
} ;
171
176
//`handleVerifyEmail` function is used to verify email with otp
172
177
const handleVerifyEmail = async ( e ) => {
173
178
e . preventDefault ( ) ;
174
179
setOtpLoader ( true ) ;
180
+ const localuser = localStorage . getItem (
181
+ `Parse/${ appInfo . appId } /currentUser`
182
+ ) ;
183
+ const currentUser = JSON . parse ( JSON . stringify ( localuser ) ) ;
175
184
try {
176
185
const resEmail = await Parse . Cloud . run ( "verifyemail" , {
177
186
otp : otp ,
178
- email : Parse . User . current ( ) . getEmail ( )
187
+ email : currentUser ?. email
179
188
} ) ;
180
189
if ( resEmail ?. message === "Email is verified." ) {
181
190
setIsEmailVerified ( true ) ;
@@ -196,7 +205,11 @@ function PdfRequestFiles() {
196
205
//`handleVerifyBtn` function is used to send otp on user mail
197
206
const handleVerifyBtn = async ( ) => {
198
207
setIsVerifyModal ( true ) ;
199
- await handleSendOTP ( Parse . User . current ( ) . getEmail ( ) ) ;
208
+ const localuser = localStorage . getItem (
209
+ `Parse/${ appInfo . appId } /currentUser`
210
+ ) ;
211
+ const currentUser = JSON . parse ( JSON . stringify ( localuser ) ) ;
212
+ await handleSendOTP ( currentUser ?. email ) ;
200
213
} ;
201
214
async function checkIsSubscribed ( extUserId , contactId ) {
202
215
const isGuestSign = location . pathname . includes ( "/load/" ) || false ;
@@ -460,8 +473,11 @@ function PdfRequestFiles() {
460
473
} else {
461
474
//else condition to check current user exist in contracts_Users class and check tour message status
462
475
//if not then check user exist in contracts_Contactbook class and check tour message status
463
- const currentUser = JSON . parse ( JSON . stringify ( Parse . User . current ( ) ) ) ;
464
- const currentUserEmail = currentUser . email ;
476
+ const localuser = localStorage . getItem (
477
+ `Parse/${ appInfo . appId } /currentUser`
478
+ ) ;
479
+ const currentUser = JSON . parse ( JSON . stringify ( localuser ) ) ;
480
+ const currentUserEmail = currentUser ?. email ;
465
481
const res = await contractUsers ( currentUserEmail ) ;
466
482
if ( res === "Error: Something went wrong!" ) {
467
483
setHandleError ( "Error: Something went wrong!" ) ;
0 commit comments