Skip to content

Commit c6be819

Browse files
fix: conflict resolved in userProfile
1 parent 6b47f6a commit c6be819

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

apps/OpenSign/src/pages/UserProfile.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function UserProfile() {
112112
await query.get(UserProfile.objectId).then((object) => {
113113
object.set("name", name);
114114
object.set("ProfilePic", Image);
115-
object.set("phone", phn);
115+
object.set("phone", phn || "");
116116

117117
object.save().then(
118118
async (response) => {
@@ -121,15 +121,18 @@ function UserProfile() {
121121
let rr = JSON.stringify(res);
122122
localStorage.setItem("UserInformation", rr);
123123
SetName(res.name);
124-
SetPhone(res.phone);
124+
SetPhone(res?.phone || "");
125125
setImage(res.ProfilePic);
126126
localStorage.setItem("username", res.name);
127127
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+
});
129132
alert("Profile updated successfully.");
130133
setEditMode(false);
131134
setIsLoader(false);
132-
// navigate("/dashboard/35KBoSgoAK");
135+
//navigate("/dashboard/35KBoSgoAK");
133136
}
134137
},
135138
(error) => {
@@ -169,7 +172,6 @@ function UserProfile() {
169172
Company: company
170173
};
171174
}
172-
173175
await axios.put(
174176
parseBaseUrl + "classes/" + extClass + "/" + ExtUserId,
175177
body,
@@ -188,6 +190,7 @@ function UserProfile() {
188190
const json = JSON.parse(JSON.stringify([res]));
189191
const extRes = JSON.stringify(json);
190192
localStorage.setItem("Extand_Class", extRes);
193+
// console.log("updateRes ", updateRes);
191194
};
192195
// file upload function
193196
const fileUpload = async (file) => {
@@ -279,7 +282,8 @@ function UserProfile() {
279282
setOtpLoader(false);
280283
alert("OTP sent on you email");
281284
};
282-
const handlePublicUrl = (e) => {
285+
//function to handle onchange user name nad restict 6 characters username for free users
286+
const handleOnchangeUserName = (e) => {
283287
const value = e.target.value;
284288
if (value.length > 6 && !isSubscribe) {
285289
setUserNameError("Please upgrade to allow more than 6 characters.");
@@ -453,7 +457,7 @@ function UserProfile() {
453457
<span>opensign.me/</span>
454458

455459
<input
456-
onChange={handlePublicUrl}
460+
onChange={handleOnchangeUserName}
457461
value={publicUserName}
458462
disabled={!editmode}
459463
placeholder="enter user name"
@@ -462,7 +466,6 @@ function UserProfile() {
462466
</div>
463467
</li>
464468
{/* )} */}
465-
466469
<li className="border-y-[1px] border-gray-300 break-all">
467470
<div className="flex justify-between items-center py-2">
468471
<span

0 commit comments

Comments
 (0)