Merge pull request #3156 from bluewave-labs/fix/monitor/pause-button

Fix: Configure Pause Button
This commit is contained in:
Alexander Holliday
2026-01-21 09:20:53 -08:00
committed by GitHub
2 changed files with 9 additions and 8 deletions
@@ -124,7 +124,7 @@ const MonitorDetailsControlHeader = ({
});
}}
>
{monitor?.isActive ? "Pause" : "Resume"}
{monitor?.isActive ? t("pause") : t("resume")}
</Button>
)}
{isAdmin && (
+8 -7
View File
@@ -80,13 +80,13 @@ const UptimeCreate = ({ isClone = false }) => {
const [isFetchingMonitor] = useFetchMonitorById({
monitorId,
setMonitor,
updateTrigger: true,
updateTrigger,
});
// Fetch games
const [isFetchingGames] = useFetchMonitorGames({
setGames,
triggerUpdate: true,
updateTrigger,
});
// Combine the loading states
@@ -283,10 +283,6 @@ const UptimeCreate = ({ isClone = false }) => {
}));
};
const handlePause = async () => {
await pauseMonitor({ monitorId, triggerUpdate });
};
const handleRemove = async (event) => {
event.preventDefault();
const TEMP_MONITOR = { id: monitor.id };
@@ -438,7 +434,12 @@ const UptimeCreate = ({ isClone = false }) => {
/>
)
}
onClick={handlePause}
onClick={() => {
pauseMonitor({
monitorId: monitor?.id,
triggerUpdate,
});
}}
>
{monitor?.isActive ? t("pause") : t("resume")}
</Button>