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 share url.

Brian Cao306aafd9525b
diff --git a/src/app/(main)/websites/[websiteId]/settings/ShareEditForm.tsx b/src/app/(main)/websites/[websiteId]/settings/ShareEditForm.tsx
index 4b86247ac..00598fcfd 100644
--- a/src/app/(main)/websites/[websiteId]/settings/ShareEditForm.tsx
+++ b/src/app/(main)/websites/[websiteId]/settings/ShareEditForm.tsx
@@ -40,10 +40,7 @@ export function ShareEditForm({
const isEditing = !!shareId;
const getUrl = (slug: string) => {
- if (cloudMode) {
- return `${process.env.cloudUrl}/share/${slug}`;
- }
- return `${window?.location.origin}${process.env.basePath || ''}/share/${slug}`;
+ return `${cloudMode ? process.env.cloudUrl : window?.location.origin}${process.env.basePath || ''}/share/${slug}`;
};
useEffect(() => {
@@ -74,9 +71,16 @@ export function ShareEditForm({
try {
if (isEditing) {
- await post(`/share/id/${shareId}`, { name: data.name, slug: share.slug, parameters });
+ await post(`/share/id/${shareId}`, {
+ name: data.name,
+ slug: share.slug,
+ parameters,
+ });
} else {
- await post(`/websites/${websiteId}/shares`, { name: data.name, parameters });
+ await post(`/websites/${websiteId}/shares`, {
+ name: data.name,
+ parameters,
+ });
}
touch('shares');
onSave?.();