chore: usePolling on fetchMyRoles
@@ -34,19 +34,21 @@ const Navigation: React.FC<Props> = ({ children }) => {
usePolling(fetchPinnedWorkspaces);
usePolling(fetchUserSettings, { interval: 60000 });
- useEffect(() => {
- fetchResourcePools();
-
- return () => canceler.abort();
- }, [canceler, fetchResourcePools]);
-
const rbacEnabled = useFeature().isOn('rbac');
- useEffect(() => {
+ usePolling(
+ () => {
if (rbacEnabled) {
fetchMyRoles();
}
+ },
+ { interval: 120000 },
+ );
+
+ useEffect(() => {
+ fetchResourcePools();
+
return () => canceler.abort();
- }, [canceler, fetchMyRoles, rbacEnabled]);
+ }, [canceler, fetchResourcePools]);
return (
<Spinner spinning={ui.showSpinner}>
