@@ -170,18 +170,26 @@ function PdfRequestFiles() {
170
170
const handleResend = async ( e ) => {
171
171
e . preventDefault ( ) ;
172
172
setOtpLoader ( true ) ;
173
- await handleSendOTP ( Parse . User . current ( ) . getEmail ( ) ) ;
173
+ const localuser = localStorage . getItem (
174
+ `Parse/${ appInfo . appId } /currentUser`
175
+ ) ;
176
+ const currentUser = JSON . parse ( JSON . stringify ( localuser ) ) ;
177
+ await handleSendOTP ( currentUser ?. email ) ;
174
178
setOtpLoader ( false ) ;
175
179
alert ( "OTP sent on you email" ) ;
176
180
} ;
177
181
//`handleVerifyEmail` function is used to verify email with otp
178
182
const handleVerifyEmail = async ( e ) => {
179
183
e . preventDefault ( ) ;
180
184
setOtpLoader ( true ) ;
185
+ const localuser = localStorage . getItem (
186
+ `Parse/${ appInfo . appId } /currentUser`
187
+ ) ;
188
+ const currentUser = JSON . parse ( JSON . stringify ( localuser ) ) ;
181
189
try {
182
190
const resEmail = await Parse . Cloud . run ( "verifyemail" , {
183
191
otp : otp ,
184
- email : Parse . User . current ( ) . getEmail ( )
192
+ email : currentUser ?. email
185
193
} ) ;
186
194
if ( resEmail ?. message === "Email is verified." ) {
187
195
setIsEmailVerified ( true ) ;
@@ -202,7 +210,11 @@ function PdfRequestFiles() {
202
210
//`handleVerifyBtn` function is used to send otp on user mail
203
211
const handleVerifyBtn = async ( ) => {
204
212
setIsVerifyModal ( true ) ;
205
- await handleSendOTP ( Parse . User . current ( ) . getEmail ( ) ) ;
213
+ const localuser = localStorage . getItem (
214
+ `Parse/${ appInfo . appId } /currentUser`
215
+ ) ;
216
+ const currentUser = JSON . parse ( JSON . stringify ( localuser ) ) ;
217
+ await handleSendOTP ( currentUser ?. email ) ;
206
218
} ;
207
219
async function checkIsSubscribed ( extUserId , contactId ) {
208
220
const isGuestSign = location . pathname . includes ( "/load/" ) || false ;
@@ -497,7 +509,6 @@ function PdfRequestFiles() {
497
509
const objectId = res [ 0 ] . objectId ;
498
510
setSignerUserId ( objectId ) ;
499
511
const tourData = res [ 0 ] . TourStatus && res [ 0 ] . TourStatus ;
500
-
501
512
if ( tourData && tourData . length > 0 ) {
502
513
setTourStatus ( tourData ) ;
503
514
setRequestSignTour ( tourData [ 0 ] ?. requestSign || false ) ;
0 commit comments