Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

fix getURL for share

Francis Cao7514af42362e
diff --git a/src/app/(main)/websites/[websiteId]/settings/ShareEditForm.tsx b/src/app/(main)/websites/[websiteId]/settings/ShareEditForm.tsx
index 00598fcfd..a71a49277 100644
--- a/src/app/(main)/websites/[websiteId]/settings/ShareEditForm.tsx
+++ b/src/app/(main)/websites/[websiteId]/settings/ShareEditForm.tsx
@@ -40,7 +40,10 @@ export function ShareEditForm({
const isEditing = !!shareId;
const getUrl = (slug: string) => {
- return `${cloudMode ? process.env.cloudUrl : window?.location.origin}${process.env.basePath || ''}/share/${slug}`;
+ if (cloudMode) {
+ return `${process.env.cloudUrl}/share/${slug}`;
+ }
+ return `${window?.location.origin}${process.env.basePath || ''}/share/${slug}`;
};
useEffect(() => {
diff --git a/src/app/(main)/websites/[websiteId]/settings/SharesTable.tsx b/src/app/(main)/websites/[websiteId]/settings/SharesTable.tsx
index e997d2476..52f8a0579 100644
--- a/src/app/(main)/websites/[websiteId]/settings/SharesTable.tsx
+++ b/src/app/(main)/websites/[websiteId]/settings/SharesTable.tsx
@@ -11,7 +11,10 @@ export function SharesTable(props: DataTableProps) {
const { isMobile } = useMobile();
const getUrl = (slug: string) => {
- return `${cloudMode ? process.env.cloudUrl : window?.location.origin}${process.env.basePath || ''}/share/${slug}`;
+ if (cloudMode) {
+ return `${process.env.cloudUrl}/share/${slug}`;
+ }
+ return `${window?.location.origin}${process.env.basePath || ''}/share/${slug}`;
};
return (