Skip to content

🔥 The free & Open Source DocuSign alternative

fix: resolve public url

RaktimaNXGf4466dc3250e
diff --git a/apps/OpenSign/src/pages/UserProfile.js b/apps/OpenSign/src/pages/UserProfile.js
index 0ef940688..df42f0e0b 100644
--- a/apps/OpenSign/src/pages/UserProfile.js
+++ b/apps/OpenSign/src/pages/UserProfile.js
@@ -7,7 +7,7 @@ import Title from "../components/Title";
import sanitizeFileName from "../primitives/sanitizeFileName";
import axios from "axios";
import Tooltip from "../primitives/Tooltip";
-import { isEnableSubscription } from "../constant/const";
+import { isEnableSubscription, isStaging } from "../constant/const";
import {
checkIsSubscribed,
checkIsSubscribedTeam,
@@ -476,7 +476,9 @@ function UserProfile() {
/>
</span>
<div className="flex md:flex-row flex-col md:items-center">
- <span className="mb-1 md:mb-1">opensign.me/</span>
+ <span className="mb-1 md:mb-1">
+ {isStaging ? "staging.opensign.me/" : " opensign.me/"}
+ </span>
{editmode ? (
<input
maxLength={40}
diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js
index 2890ce043..8991c800d 100644
--- a/apps/OpenSign/src/primitives/GetReportDisplay.js
+++ b/apps/OpenSign/src/primitives/GetReportDisplay.js
@@ -4,7 +4,7 @@ import { useLocation, useNavigate } from "react-router-dom";
import axios from "axios";
import ModalUi from "./ModalUi";
import AddSigner from "../components/AddSigner";
-import { isEnableSubscription } from "../constant/const";
+import { isEnableSubscription, isStaging } from "../constant/const";
import Alert from "./Alert";
import Tooltip from "./Tooltip";
import { RWebShare } from "react-web-share";
@@ -990,9 +990,16 @@ const ReportTable = (props) => {
}
};
+ const publicUrl = () => {
+ const subDomain = isStaging
+ ? `https://staging.opensign.me/`
+ : `https://opensign.me/`;
+ const url = `${subDomain}${publicUserName}`;
+ return url;
+ };
// function to copy public profile links
const copytoProfileLink = () => {
- const url = `https://opensign.me/${publicUserName}`;
+ const url = publicUrl();
copytoData(url);
setIsAlert(true);
setAlertMsg({
@@ -1326,7 +1333,9 @@ const ReportTable = (props) => {
<span
onClick={() => copytoProfileLink()}
className="underline underline-offset-2 w-[150px] md:w-[350px] whitespace-nowrap overflow-hidden text-ellipsis cursor-pointer"
- >{`https://opensign.me/${publicUserName}`}</span>
+ >
+ {publicUrl()}
+ </span>
</div>
</div>
) : (