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.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Fix session avatar href
Francis Cao163e46d1f15b
diff --git a/src/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsx b/src/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsxindex b4714b430..1b8f441a5 100644--- a/src/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsx+++ b/src/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsx@@ -4,20 +4,17 @@ import { SessionsTable } from './SessionsTable';export function SessionsDataTable({ websiteId }: { websiteId: string }) {const queryResult = useWebsiteSessionsQuery(websiteId);- const { pathname } = useNavigation();- const isSharePage = pathname.includes('/share/');+ const { updateParams } = useNavigation();return (<DataGrid query={queryResult} allowPaging allowSearch>- {({ data }) => {- return (- <SessionsTable- data={data}- websiteId={websiteId}- getSessionHref={isSharePage ? () => undefined : undefined}- />- );- }}+ {({ data }) => (+ <SessionsTable+ data={data}+ websiteId={websiteId}+ getSessionHref={row => updateParams({ session: row.id })}+ />+ )}</DataGrid>);}diff --git a/src/app/(main)/websites/[websiteId]/sessions/SessionsPage.tsx b/src/app/(main)/websites/[websiteId]/sessions/SessionsPage.tsxindex adce5ec9c..f891f2ad7 100644--- a/src/app/(main)/websites/[websiteId]/sessions/SessionsPage.tsx+++ b/src/app/(main)/websites/[websiteId]/sessions/SessionsPage.tsx@@ -5,6 +5,7 @@ import { WebsiteControls } from '@/app/(main)/websites/[websiteId]/WebsiteControimport { Panel } from '@/components/common/Panel';import { useMessages } from '@/components/hooks';import { getItem, setItem } from '@/lib/storage';+import { SessionModal } from './SessionModal';import { SessionProperties } from './SessionProperties';import { SessionsDataTable } from './SessionsDataTable';@@ -22,6 +23,7 @@ export function SessionsPage({ websiteId }) {return (<Column gap="3"><WebsiteControls websiteId={websiteId} />+ <SessionModal websiteId={websiteId} /><Panel><Tabs selectedKey={tab} onSelectionChange={handleSelect}><TabList>diff --git a/src/app/(main)/websites/[websiteId]/sessions/SessionsTable.tsx b/src/app/(main)/websites/[websiteId]/sessions/SessionsTable.tsxindex 69f32afa7..1f3d451a7 100644--- a/src/app/(main)/websites/[websiteId]/sessions/SessionsTable.tsx+++ b/src/app/(main)/websites/[websiteId]/sessions/SessionsTable.tsx@@ -16,16 +16,11 @@ export function SessionsTable({return (<DataTable {...props}><DataColumn id="id" label={t(labels.session)} width="100px">- {(row: any) => {- const href = getSessionHref ? getSessionHref(row) : `/websites/${websiteId}/sessions/${row.id}`;- return href ? (- <Link href={href}>- <Avatar seed={row.id} size={32} />- </Link>- ) : (+ {(row: any) => (+ <Link href={getSessionHref ? getSessionHref(row) : `/websites/${websiteId}/sessions/${row.id}`}><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" />