Compare commits

...
8 Commits
4 changed files with 35 additions and 28 deletions
+4 -2
View File
@@ -49,6 +49,7 @@ const AddSigner = (props) => {
e.preventDefault();
e.stopPropagation();
setIsLoader(true);
if (localStorage.getItem("TenantId")) {
try {
const contactQuery = new Parse.Object("contracts_Contactbook");
contactQuery.set("Name", name);
@@ -56,13 +57,11 @@ const AddSigner = (props) => {
contactQuery.set("Email", email);
contactQuery.set("UserRole", "contracts_Guest");
if (localStorage.getItem("TenantId")) {
contactQuery.set("TenantId", {
__type: "Pointer",
className: "partners_Tenant",
objectId: localStorage.getItem("TenantId")
});
}
try {
const _users = Parse.Object.extend("User");
@@ -188,6 +187,9 @@ const AddSigner = (props) => {
setIsLoader(false);
alert("something went wrong!");
}
}else{
alert('something went wrong, please try again later')
}
};
// Define a function to handle the "add yourself" checkbox
+7 -7
View File
@@ -566,13 +566,13 @@ export const signPdfFun = async (
// for adding it in completion certificate
let getSignature;
for (let item of xyPosition) {
const typeExist = item.pos.some((data) => data?.type);
if (typeExist) {
getSignature = item.pos.find((data) => data?.type === "signature");
break;
} else {
getSignature = item.pos.find((data) => !data.isStamp);
break;
if (!getSignature) {
const typeExist = item.pos.some((data) => data?.type);
if (typeExist) {
getSignature = item.pos.find((data) => data?.type === "signature");
} else {
getSignature = item.pos.find((data) => !data.isStamp);
}
}
}
+23 -18
View File
@@ -28,29 +28,34 @@ const HomeLayout = () => {
const [tourConfigs, setTourConfigs] = useState([]);
const [, setCookie] = useCookies(["accesstoken", "main_Domain"]);
const tenantId = localStorage.getItem("TenantId");
useEffect(() => {
(async () => {
try {
// Use the session token to validate the user
const userQuery = new Parse.Query(Parse.User);
const user = await userQuery.get(Parse.User.current().id, {
sessionToken: localStorage.getItem("accesstoken")
});
if (user) {
localStorage.setItem("profileImg", user.get("ProfilePic") || "");
checkIsSubscribed();
} else {
if (!tenantId) {
setIsUserValid(false);
} else {
(async () => {
try {
// Use the session token to validate the user
const userQuery = new Parse.Query(Parse.User);
const user = await userQuery.get(Parse.User.current().id, {
sessionToken: localStorage.getItem("accesstoken")
});
if (user) {
localStorage.setItem("profileImg", user.get("ProfilePic") || "");
checkIsSubscribed();
} else {
setIsUserValid(false);
}
} catch (error) {
// Session token is invalid or there was an error
setIsUserValid(false);
}
} catch (error) {
// Session token is invalid or there was an error
setIsUserValid(false);
}
})();
saveCookies();
})();
saveCookies();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [tenantId]);
//function to use save data in cookies storage
const saveCookies = () => {
const main_Domain = window.location.origin;
+1 -1
View File
@@ -24,7 +24,7 @@ const Dashboard = () => {
getDashboard(localStorage.getItem("PageLanding"));
}
} else {
navigate("/", { replace: true, state: { from: location } });
navigate("/", { replace: true, state: { from: "" } });
}
// eslint-disable-next-line
}, [id]);