web: fix rerender of chart

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-02-13 11:35:36 +01:00
parent 7f2c0f6cf0
commit 9011daa4d5
2 changed files with 11 additions and 2 deletions

View File

@@ -205,7 +205,12 @@ export default function OverviewMetrics({ projectId }: OverviewMetricsProps) {
</WidgetHead>
<WidgetBody>
<Suspense fallback={<ChartLoading />}>
<Chart hideID {...selectedMetric} chartType="linear" />
<Chart
key={selectedMetric.id}
hideID
{...selectedMetric}
chartType="linear"
/>
</Suspense>
</WidgetBody>
</Widget>

View File

@@ -4,7 +4,11 @@ import { authMiddleware } from '@clerk/nextjs';
// Please edit this to allow other routes to be public as needed.
// See https://clerk.com/docs/references/nextjs/auth-middleware for more information about configuring your Middleware
export default authMiddleware({
publicRoutes: ['/share/overview/:id', '/api/trpc/chart.chart'],
publicRoutes: [
'/share/overview/:id',
'/api/trpc/chart.chart',
'/api/trpc/chart.values',
],
});
export const config = {