Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

a few generic fixes

Blue Mouse4f2979b3c813
diff --git a/backend/apps/community/src/project/project.controller.ts b/backend/apps/community/src/project/project.controller.ts
index aaf297378..f18339be4 100644
--- a/backend/apps/community/src/project/project.controller.ts
+++ b/backend/apps/community/src/project/project.controller.ts
@@ -158,6 +158,7 @@ export class ProjectController {
role: userId ? 'owner' : 'viewer',
isLocked: false,
isAccessConfirmed: true,
+ isAnalyticsProject: true,
}))
return {
@@ -598,6 +599,7 @@ export class ProjectController {
role: userId ? 'owner' : 'viewer',
isLocked: false,
isAccessConfirmed: true,
+ isAnalyticsProject: true,
})
}
diff --git a/web/app/pages/Dashboard/ProjectCard.tsx b/web/app/pages/Dashboard/ProjectCard.tsx
index da0f3aa7a..3fabfa2ca 100644
--- a/web/app/pages/Dashboard/ProjectCard.tsx
+++ b/web/app/pages/Dashboard/ProjectCard.tsx
@@ -43,10 +43,12 @@ interface MiniCardProps {
percChange?: number
}
-const MiniCard = ({ labelTKey, total = 0, percChange }: MiniCardProps) => {
+const MiniCard = ({ labelTKey, total, percChange }: MiniCardProps) => {
const { t } = useTranslation('common')
const statsDidGrowUp = percChange ? percChange >= 0 : false
+ console.log('MiniCard total', total)
+
return (
<div>
<p className='text-sm text-gray-500 dark:text-gray-300'>{t(labelTKey)}</p>
@@ -85,14 +87,7 @@ const MiniCard = ({ labelTKey, total = 0, percChange }: MiniCardProps) => {
)
}
-export const ProjectCard = ({
- live = null,
- project,
- overallStats,
- activePeriod,
- activeTab,
- viewMode,
-}: ProjectCardProps) => {
+export const ProjectCard = ({ live, project, overallStats, activePeriod, activeTab, viewMode }: ProjectCardProps) => {
const { t } = useTranslation('common')
const [showInviteModal, setShowInviteModal] = useState(false)
const isHostnameNavigationEnabled = useFeatureFlag(FeatureFlag['dashboard-hostname-cards'])
@@ -207,6 +202,9 @@ export const ProjectCard = ({
return params.toString()
}, [showPeriodSelector, activePeriod, isHostnameNavigationEnabled, project.name])
+ console.log('project:', project)
+ console.log('ProjectCard live', live)
+
return (
<Link
to={{
@@ -264,7 +262,7 @@ export const ProjectCard = ({
}
/>
)}
- {project.isAnalyticsProject && <MiniCard labelTKey='dashboard.liveVisitors' total={live} />}
+ {project.isAnalyticsProject ? <MiniCard labelTKey='dashboard.liveVisitors' total={live} /> : null}
</div>
{project.role !== 'owner' && !project.isAccessConfirmed && (
<Modal
diff --git a/web/app/routes/feature-flags.tsx b/web/app/routes/feature-flags.tsx
index d71f88d54..1acf8f1e0 100644
--- a/web/app/routes/feature-flags.tsx
+++ b/web/app/routes/feature-flags.tsx
@@ -28,7 +28,7 @@ const FeatureFlagsPage = () => {
}
if (user) {
- setFlags(user.featureFlags)
+ setFlags(user.featureFlags ?? [])
setInitialised(true)
return
}