Skip to content

Commit

Permalink
Update UpgradeOverlay.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielHougaard committed Feb 22, 2024
1 parent 4553c6b commit 52cfa1b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/components/v2/UpgradeOverlay/UpgradeOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ export const UpgradeOverlay = () => {
const router = useRouter();
const { currentWorkspace } = useWorkspace();
const [isUpgrading, setIsUpgrading] = useToggle(false);

const isProjectRoute = router.pathname.includes("/project");

const { isLoading: isUpgradeStatusLoading } = useGetUpgradeProjectStatus({
projectId: currentWorkspace?.id ?? "",
enabled: currentWorkspace?.version === ProjectVersion.V1,
enabled: isProjectRoute && currentWorkspace && currentWorkspace.version === ProjectVersion.V1,
refetchInterval: 5_000,
onSuccess: (data) => {
if (!data) return;
Expand All @@ -26,7 +29,7 @@ export const UpgradeOverlay = () => {
});

// make sure only to display this on /project routes
if (!currentWorkspace || !router.pathname.includes("/project")) {
if (!currentWorkspace || !isProjectRoute) {
return null;
}

Expand Down

0 comments on commit 52cfa1b

Please sign in to comment.