Skip to content

Commit

Permalink
fix: error boundary plausible (#3389)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Mar 27, 2023
1 parent dec16ce commit a1535ae
Showing 1 changed file with 55 additions and 49 deletions.
104 changes: 55 additions & 49 deletions frontend/src/component/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,61 +48,67 @@ export const App = () => {

return (
<ErrorBoundary FallbackComponent={Error}>
<SWRProvider>
<Suspense fallback={<Loader />}>
<PlausibleProvider>
<ConditionallyRender
condition={!hasFetchedAuth}
show={<Loader />}
elseShow={
<>
<ConditionallyRender
condition={Boolean(
uiConfig?.maintenanceMode
)}
show={<MaintenanceBanner />}
/>
<StyledContainer>
<ToastRenderer />
<Routes>
{availableRoutes.map(route => (
<PlausibleProvider>
<ErrorBoundary FallbackComponent={Error}>
<SWRProvider>
<Suspense fallback={<Loader />}>
<ConditionallyRender
condition={!hasFetchedAuth}
show={<Loader />}
elseShow={
<>
<ConditionallyRender
condition={Boolean(
uiConfig?.maintenanceMode
)}
show={<MaintenanceBanner />}
/>
<StyledContainer>
<ToastRenderer />
<Routes>
{availableRoutes.map(route => (
<Route
key={route.path}
path={route.path}
element={
<LayoutPicker
isStandalone={
route.isStandalone ===
true
}
>
<ProtectedRoute
route={
route
}
/>
</LayoutPicker>
}
/>
))}
<Route
key={route.path}
path={route.path}
path="/"
element={
<LayoutPicker
isStandalone={
route.isStandalone ===
true
}
>
<ProtectedRoute
route={route}
/>
</LayoutPicker>
<InitialRedirect />
}
/>
))}
<Route
path="/"
element={<InitialRedirect />}
/>
<Route
path="*"
element={<NotFound />}
/>
</Routes>
<Route
path="*"
element={<NotFound />}
/>
</Routes>

<FeedbackNPS openUrl="http://feedback.unleash.run" />
<FeedbackNPS openUrl="http://feedback.unleash.run" />

<SplashPageRedirect />
</StyledContainer>
</>
}
/>
</PlausibleProvider>
</Suspense>
</SWRProvider>
<SplashPageRedirect />
</StyledContainer>
</>
}
/>
</Suspense>
</SWRProvider>
</ErrorBoundary>
</PlausibleProvider>
</ErrorBoundary>
);
};

0 comments on commit a1535ae

Please sign in to comment.