mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-17 21:25:54 +02:00
fix: resolve warning
This commit is contained in:
@@ -11,8 +11,7 @@ export const isEnableSubscription =
|
||||
: false;
|
||||
export const isStaging =
|
||||
window.location.origin === "https://staging-app.opensignlabs.com";
|
||||
export const isPublic =
|
||||
window.location.origin === "https://opensign.me" ||
|
||||
window.location.origin === "https://staging.opensign.me";
|
||||
export const isPublicProduction =
|
||||
window.location.origin === "https://opensign.me";
|
||||
export const isPublicStaging =
|
||||
window.location.origin === "https://staging.opensign.me";
|
||||
|
||||
@@ -2,12 +2,14 @@ import i18n from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
import Backend from "i18next-http-backend";
|
||||
import LanguageDetector from "i18next-browser-languagedetector";
|
||||
import { isPublic } from "./constant/const";
|
||||
import { isPublicProduction, isPublicStaging } from "./constant/const";
|
||||
|
||||
//handle path to support language on public profile
|
||||
const backendPath = isPublic
|
||||
const backendPath = isPublicStaging
|
||||
? "https://staging-app.opensignlabs.com/locales/{{lng}}/{{ns}}.json"
|
||||
: "/locales/{{lng}}/{{ns}}.json";
|
||||
: isPublicProduction
|
||||
? "https://app.opensignlabs.com/locales/{{lng}}/{{ns}}.json"
|
||||
: "/locales/{{lng}}/{{ns}}.json";
|
||||
|
||||
i18n
|
||||
.use(Backend)
|
||||
|
||||
@@ -190,28 +190,20 @@ function PlaceHolderSign() {
|
||||
|
||||
if (user) {
|
||||
try {
|
||||
const defaultRequestBody = `<p>Hi {{receiver_name}},</p><br><p>We hope this email finds you well. {{sender_name}} has requested you to review and sign {{document_title}}.</p><p>Your signature is crucial to proceed with the next steps as it signifies your agreement and authorization.</p><br><p>{{signing_url}}</p><br><p>If you have any questions or need further clarification regarding the document or the signing process, please contact the sender.</p><br><p>Thanks</p><p> Team OpenSign™</p><br>`;
|
||||
const defaultSubject = `{{sender_name}} has requested you to sign {{document_title}}`;
|
||||
setDefaultBody(defaultRequestBody);
|
||||
setDefaultSubject(defaultSubject);
|
||||
const tenantDetails = await getTenantDetails(user?.objectId);
|
||||
if (tenantDetails && tenantDetails === "user does not exist!") {
|
||||
alert(t("user-not-exist"));
|
||||
} else if (tenantDetails) {
|
||||
const defaultRequestBody = `<p>Hi {{receiver_name}},</p><br><p>We hope this email finds you well. {{sender_name}} has requested you to review and sign {{document_title}}.</p><p>Your signature is crucial to proceed with the next steps as it signifies your agreement and authorization.</p><br><p>{{signing_url}}</p><br><p>If you have any questions or need further clarification regarding the document or the signing process, please contact the sender.</p><br><p>Thanks</p><p> Team OpenSign™</p><br>`;
|
||||
if (tenantDetails?.RequestBody) {
|
||||
setRequestBody(tenantDetails?.RequestBody);
|
||||
setRequestSubject(tenantDetails?.RequestSubject);
|
||||
|
||||
setDefaultBody(defaultRequestBody);
|
||||
setDefaultSubject(
|
||||
`{{sender_name}} has requested you to sign {{document_title}}`
|
||||
);
|
||||
} else {
|
||||
setRequestBody(defaultRequestBody);
|
||||
setRequestSubject(
|
||||
`{{sender_name}} has requested you to sign {{document_title}}`
|
||||
);
|
||||
setDefaultBody(defaultRequestBody);
|
||||
setDefaultSubject(
|
||||
`{{sender_name}}has requested you to sign {{document_title}}`
|
||||
);
|
||||
setRequestSubject(defaultSubject);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -222,6 +214,7 @@ function PlaceHolderSign() {
|
||||
}
|
||||
};
|
||||
|
||||
console.log("default body", defaultBody);
|
||||
useEffect(() => {
|
||||
const updateSize = () => {
|
||||
if (divRef.current) {
|
||||
@@ -1772,8 +1765,10 @@ function PlaceHolderSign() {
|
||||
<>
|
||||
<EmailBody
|
||||
editorRef={editorRef}
|
||||
requestBody={requestBody}
|
||||
requestSubject={requestSubject}
|
||||
requestBody={requestBody || defaultBody}
|
||||
requestSubject={
|
||||
requestSubject || defaultSubject
|
||||
}
|
||||
handleOnchangeRequest={handleOnchangeRequest}
|
||||
setRequestSubject={setRequestSubject}
|
||||
/>
|
||||
|
||||
@@ -97,6 +97,7 @@ const TeamList = () => {
|
||||
const pageNumbers = getPaginationRange();
|
||||
useEffect(() => {
|
||||
fetchTeamList();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
async function fetchTeamList() {
|
||||
try {
|
||||
|
||||
@@ -85,6 +85,7 @@ const UserList = () => {
|
||||
const pageNumbers = getPaginationRange();
|
||||
useEffect(() => {
|
||||
fetchUserList();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
async function fetchUserList() {
|
||||
try {
|
||||
|
||||
@@ -57,6 +57,7 @@ function UserProfile() {
|
||||
|
||||
useEffect(() => {
|
||||
getUserDetail();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const getUserDetail = async () => {
|
||||
|
||||
@@ -23,6 +23,7 @@ const ValidateRoute = () => {
|
||||
}
|
||||
}
|
||||
})();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
const handlelogout = async () => {
|
||||
let appdata = localStorage.getItem("userSettings");
|
||||
|
||||
Reference in New Issue
Block a user