diff --git a/frontend/components/Main/MainHeader/CannotStartAgent.tsx b/frontend/components/Main/MainHeader/CannotStartAgent.tsx
index 72921d94f..cb620c449 100644
--- a/frontend/components/Main/MainHeader/CannotStartAgent.tsx
+++ b/frontend/components/Main/MainHeader/CannotStartAgent.tsx
@@ -67,13 +67,13 @@ const NoJobsAvailablePopover = () => (
export const CannotStartAgent = () => {
const {
- canStartAgent,
+ isEligibleForStakingAction,
hasEnoughServiceSlots,
isRewardsAvailable,
isAgentEvicted,
} = useStakingContractInfo();
- if (canStartAgent) return null;
+ if (isEligibleForStakingAction) return null;
if (!hasEnoughServiceSlots) return ;
if (!isRewardsAvailable) return ;
if (isAgentEvicted) return ;
diff --git a/frontend/components/Main/MainHeader/index.tsx b/frontend/components/Main/MainHeader/index.tsx
index 5423eea26..8942363f8 100644
--- a/frontend/components/Main/MainHeader/index.tsx
+++ b/frontend/components/Main/MainHeader/index.tsx
@@ -1,5 +1,13 @@
import { InfoCircleOutlined } from '@ant-design/icons';
-import { Badge, Button, Flex, Popover, Skeleton, Typography } from 'antd';
+import {
+ Badge,
+ Button,
+ ButtonProps,
+ Flex,
+ Popover,
+ Skeleton,
+ Typography,
+} from 'antd';
import Image from 'next/image';
import { useCallback, useEffect, useMemo, useState } from 'react';
@@ -86,8 +94,11 @@ export const MainHeader = () => {
const [isModalOpen, setIsModalOpen] = useState(false);
const handleModalClose = useCallback(() => setIsModalOpen(false), []);
- const { isInitialStakingLoad, isAgentEvicted, canStartAgent } =
- useStakingContractInfo();
+ const {
+ isInitialStakingLoad,
+ isEligibleForStakingAction,
+ canStartEvictedAgent,
+ } = useStakingContractInfo();
// hook to setup tray icon
useSetupTrayIcon();
@@ -208,16 +219,6 @@ export const MainHeader = () => {
}, [services, setServiceStatus]);
const serviceToggleButton = useMemo(() => {
- if (!canStartAgent) return ;
-
- if (canStartAgent && isAgentEvicted) {
- return (
-
- );
- }
-
if (serviceButtonState === ServiceButtonLoadingState.Pausing) {
return (