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.

sharePage hotfix

Francis Cao26ced6cdf228
diff --git a/src/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsx b/src/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsx
index 4b07a16c7..b4714b430 100644
--- a/src/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsx
+++ b/src/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsx
@@ -1,14 +1,22 @@
import { DataGrid } from '@/components/common/DataGrid';
-import { useWebsiteSessionsQuery } from '@/components/hooks';
+import { useNavigation, useWebsiteSessionsQuery } from '@/components/hooks';
import { SessionsTable } from './SessionsTable';
export function SessionsDataTable({ websiteId }: { websiteId: string }) {
const queryResult = useWebsiteSessionsQuery(websiteId);
+ const { pathname } = useNavigation();
+ const isSharePage = pathname.includes('/share/');
return (
<DataGrid query={queryResult} allowPaging allowSearch>
{({ data }) => {
- return <SessionsTable data={data} websiteId={websiteId} />;
+ return (
+ <SessionsTable
+ data={data}
+ websiteId={websiteId}
+ getSessionHref={isSharePage ? () => undefined : undefined}
+ />
+ );
}}
</DataGrid>
);
diff --git a/src/app/(main)/websites/[websiteId]/sessions/SessionsTable.tsx b/src/app/(main)/websites/[websiteId]/sessions/SessionsTable.tsx
index b4c684a47..69f32afa7 100644
--- a/src/app/(main)/websites/[websiteId]/sessions/SessionsTable.tsx
+++ b/src/app/(main)/websites/[websiteId]/sessions/SessionsTable.tsx
@@ -16,15 +16,16 @@ export function SessionsTable({
return (
<DataTable {...props}>
<DataColumn id="id" label={t(labels.session)} width="100px">
- {(row: any) => (
- <Link
- href={
- getSessionHref ? getSessionHref(row) : `/websites/${websiteId}/sessions/${row.id}`
- }
- >
+ {(row: any) => {
+ const href = getSessionHref ? getSessionHref(row) : `/websites/${websiteId}/sessions/${row.id}`;
+ return href ? (
+ <Link href={href}>
+ <Avatar seed={row.id} size={32} />
+ </Link>
+ ) : (
<Avatar seed={row.id} size={32} />
- </Link>
- )}
+ );
+ }}
</DataColumn>
<DataColumn id="visits" label={t(labels.visits)} width="80px" />
<DataColumn id="views" label={t(labels.views)} width="80px" />
diff --git a/src/app/share/[slug]/[[...path]]/SharePage.tsx b/src/app/share/[slug]/[[...path]]/SharePage.tsx
index 283b3f38f..a1103ffd9 100644
--- a/src/app/share/[slug]/[[...path]]/SharePage.tsx
+++ b/src/app/share/[slug]/[[...path]]/SharePage.tsx
@@ -125,7 +125,7 @@ export function SharePage() {
<PageBody gap>
<WebsiteProvider websiteId={websiteId}>
<Column>
- <WebsiteHeader showActions={false} />
+ <WebsiteHeader showActions={false} allowLink={false} />
<PageComponent websiteId={websiteId} />
</Column>
</WebsiteProvider>