fix: use current window url instead of app url in frontend
This commit is contained in:
@@ -37,8 +37,6 @@ const MyShares = () => {
|
||||
|
||||
const config = useConfig();
|
||||
|
||||
const appUrl = config.get("general.appUrl");
|
||||
|
||||
const [reverseShares, setReverseShares] = useState<MyReverseShare[]>();
|
||||
|
||||
const getReverseShares = () => {
|
||||
@@ -146,7 +144,7 @@ const MyShares = () => {
|
||||
{reverseShare.shares.map((share) => (
|
||||
<Group key={share.id} mb={4}>
|
||||
<Anchor
|
||||
href={`${appUrl}/share/${share.id}`}
|
||||
href={`${window.location.origin}/share/${share.id}`}
|
||||
target="_blank"
|
||||
>
|
||||
<Text maw={120} truncate>
|
||||
@@ -159,14 +157,12 @@ const MyShares = () => {
|
||||
size={25}
|
||||
onClick={() => {
|
||||
if (window.isSecureContext) {
|
||||
clipboard.copy(`${appUrl}/s/${share.id}`);
|
||||
clipboard.copy(
|
||||
`${window.location.origin}/s/${share.id}`,
|
||||
);
|
||||
toast.success(t("common.notify.copied"));
|
||||
} else {
|
||||
showShareLinkModal(
|
||||
modals,
|
||||
share.id,
|
||||
config.get("general.appUrl"),
|
||||
);
|
||||
showShareLinkModal(modals, share.id);
|
||||
}
|
||||
}}
|
||||
>
|
||||
@@ -197,7 +193,7 @@ const MyShares = () => {
|
||||
onClick={() => {
|
||||
if (window.isSecureContext) {
|
||||
clipboard.copy(
|
||||
`${config.get("general.appUrl")}/upload/${
|
||||
`${window.location.origin}/upload/${
|
||||
reverseShare.token
|
||||
}`,
|
||||
);
|
||||
@@ -206,7 +202,6 @@ const MyShares = () => {
|
||||
showReverseShareLinkModal(
|
||||
modals,
|
||||
reverseShare.token,
|
||||
config.get("general.appUrl"),
|
||||
);
|
||||
}
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user