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 websites check.

Mike Cao1e8c1d0d1841
diff --git a/components/metrics/RealtimeLog.js b/components/metrics/RealtimeLog.js
index 9d6c8e635..63add2683 100644
--- a/components/metrics/RealtimeLog.js
+++ b/components/metrics/RealtimeLog.js
@@ -29,7 +29,7 @@ const TYPE_ICONS = {
[TYPE_EVENT]: <Bolt />,
};
-export default function RealtimeLog({ data, websites }) {
+export default function RealtimeLog({ data, websites, websiteId }) {
const intl = useIntl();
const [locale] = useLocale();
const countryNames = useCountryNames(locale);
@@ -161,7 +161,9 @@ export default function RealtimeLog({ data, websites }) {
<Icon className={styles.icon} icon={getIcon(row)} />
{getDetail(row)}
</div>
- {websites.length > 0 && <div className={styles.website}>{getWebsite(row)?.domain}</div>}
+ {!websiteId && websites.length > 1 && (
+ <div className={styles.website}>{getWebsite(row)?.domain}</div>
+ )}
</div>
);
};
diff --git a/components/metrics/RealtimeViews.js b/components/metrics/RealtimeViews.js
index ed7797de5..c2d9c266f 100644
--- a/components/metrics/RealtimeViews.js
+++ b/components/metrics/RealtimeViews.js
@@ -64,7 +64,7 @@ export default function RealtimeViews({ websiteId, data, websites }) {
pageviews
.reduce((arr, { url, website_id }) => {
if (url?.startsWith('/')) {
- if (!websiteId && websites.length > 0) {
+ if (!websiteId && websites.length > 1) {
url = `${getDomain(website_id)}${url}`;
}
const row = arr.find(({ x }) => x === url);
diff --git a/components/pages/RealtimeDashboard.js b/components/pages/RealtimeDashboard.js
index 1a2a3f54b..8bd2289dd 100644
--- a/components/pages/RealtimeDashboard.js
+++ b/components/pages/RealtimeDashboard.js
@@ -135,7 +135,7 @@ export default function RealtimeDashboard() {
<RealtimeViews websiteId={websiteId} data={realtimeData} websites={websites} />
</GridColumn>
<GridColumn xs={12} lg={8}>
- <RealtimeLog data={realtimeData} websites={websites} />
+ <RealtimeLog websiteId={websiteId} data={realtimeData} websites={websites} />
</GridColumn>
</GridRow>
<GridRow>