@@ -112,7 +112,7 @@ function UserProfile() {
112
112
await query . get ( UserProfile . objectId ) . then ( ( object ) => {
113
113
object . set ( "name" , name ) ;
114
114
object . set ( "ProfilePic" , Image ) ;
115
- object . set ( "phone" , phn ) ;
115
+ object . set ( "phone" , phn || "" ) ;
116
116
117
117
object . save ( ) . then (
118
118
async ( response ) => {
@@ -121,15 +121,18 @@ function UserProfile() {
121
121
let rr = JSON . stringify ( res ) ;
122
122
localStorage . setItem ( "UserInformation" , rr ) ;
123
123
SetName ( res . name ) ;
124
- SetPhone ( res . phone ) ;
124
+ SetPhone ( res ? .phone || "" ) ;
125
125
setImage ( res . ProfilePic ) ;
126
126
localStorage . setItem ( "username" , res . name ) ;
127
127
localStorage . setItem ( "profileImg" , res . ProfilePic ) ;
128
- await updateExtUser ( { Name : res . name , Phone : res . phone } ) ;
128
+ await updateExtUser ( {
129
+ Name : res . name ,
130
+ Phone : res ?. phone || ""
131
+ } ) ;
129
132
alert ( "Profile updated successfully." ) ;
130
133
setEditMode ( false ) ;
131
134
setIsLoader ( false ) ;
132
- // navigate("/dashboard/35KBoSgoAK");
135
+ //navigate("/dashboard/35KBoSgoAK");
133
136
}
134
137
} ,
135
138
( error ) => {
@@ -169,7 +172,6 @@ function UserProfile() {
169
172
Company : company
170
173
} ;
171
174
}
172
-
173
175
await axios . put (
174
176
parseBaseUrl + "classes/" + extClass + "/" + ExtUserId ,
175
177
body ,
@@ -188,6 +190,7 @@ function UserProfile() {
188
190
const json = JSON . parse ( JSON . stringify ( [ res ] ) ) ;
189
191
const extRes = JSON . stringify ( json ) ;
190
192
localStorage . setItem ( "Extand_Class" , extRes ) ;
193
+ // console.log("updateRes ", updateRes);
191
194
} ;
192
195
// file upload function
193
196
const fileUpload = async ( file ) => {
@@ -279,7 +282,8 @@ function UserProfile() {
279
282
setOtpLoader ( false ) ;
280
283
alert ( "OTP sent on you email" ) ;
281
284
} ;
282
- const handlePublicUrl = ( e ) => {
285
+ //function to handle onchange user name nad restict 6 characters username for free users
286
+ const handleOnchangeUserName = ( e ) => {
283
287
const value = e . target . value ;
284
288
if ( value . length > 6 && ! isSubscribe ) {
285
289
setUserNameError ( "Please upgrade to allow more than 6 characters." ) ;
@@ -453,7 +457,7 @@ function UserProfile() {
453
457
< span > opensign.me/</ span >
454
458
455
459
< input
456
- onChange = { handlePublicUrl }
460
+ onChange = { handleOnchangeUserName }
457
461
value = { publicUserName }
458
462
disabled = { ! editmode }
459
463
placeholder = "enter user name"
@@ -462,7 +466,6 @@ function UserProfile() {
462
466
</ div >
463
467
</ li >
464
468
{ /* )} */ }
465
-
466
469
< li className = "border-y-[1px] border-gray-300 break-all" >
467
470
< div className = "flex justify-between items-center py-2" >
468
471
< span
0 commit comments