Skip to content

Commit 36911e4

Browse files
committed
remove polling
1 parent 3b3a517 commit 36911e4

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

apps/webapp/app/components/navigation/EnvironmentSelector.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import { ChevronRightIcon, Cog8ToothIcon } from "@heroicons/react/20/solid";
22
import { DEFAULT_DEV_BRANCH } from "@trigger.dev/core/v3/utils/gitBranch";
33
import { isBranchableEnvironment } from "~/utils/branchableEnvironment";
44
import { DropdownIcon } from "~/assets/icons/DropdownIcon";
5-
import { useNavigation } from "@remix-run/react";
5+
import { useNavigation, useRevalidator } from "@remix-run/react";
66
import { useEffect, useRef, useState } from "react";
77
import { BranchEnvironmentIconSmall } from "~/assets/icons/EnvironmentIcons";
8-
import { useAutoRevalidate } from "~/hooks/useAutoRevalidate";
98
import { useEnvironment } from "~/hooks/useEnvironment";
109
import { useEnvironmentSwitcher } from "~/hooks/useEnvironmentSwitcher";
1110
import { useFeatures } from "~/hooks/useFeatures";
@@ -53,9 +52,7 @@ export function EnvironmentSelector({
5352
const [isMenuOpen, setIsMenuOpen] = useState(false);
5453
const navigation = useNavigation();
5554
const { urlForEnvironment } = useEnvironmentSwitcher();
56-
57-
// Keep branch list fresh, only fires while the menu is open
58-
const revalidator = useAutoRevalidate({ interval: 5000, disabled: !isMenuOpen });
55+
const revalidator = useRevalidator();
5956

6057
useEffect(() => {
6158
setIsMenuOpen(false);

0 commit comments

Comments
 (0)