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.

Updated team provider.

Mike Caod307eb4317ed
diff --git a/src/app/(main)/teams/[teamId]/TeamProvider.tsx b/src/app/(main)/teams/[teamId]/TeamProvider.tsx
index 6f0e391b4..1ccdfd64b 100644
--- a/src/app/(main)/teams/[teamId]/TeamProvider.tsx
+++ b/src/app/(main)/teams/[teamId]/TeamProvider.tsx
@@ -5,21 +5,21 @@ import useModified from 'store/modified';
export const TeamContext = createContext(null);
-export function TeamProvider({ teamId, children }: { teamId: string; children: ReactNode }) {
+export function TeamProvider({ teamId, children }: { teamId?: string; children: ReactNode }) {
const modified = useModified(state => state?.[`team:${teamId}`]);
const { data: team, isLoading, isFetching, refetch } = useTeam(teamId);
useEffect(() => {
- if (modified) {
+ if (teamId && modified) {
refetch();
}
- }, [modified]);
+ }, [teamId, modified]);
if (isFetching && isLoading) {
return <Loading />;
}
- if (!team) {
+ if (teamId && !team) {
return null;
}