Merge pull request #1383 from bluewave-labs/fix/fe/monitor-pause-toast

fix: add pause toast to PageSpeed and Uptime configure pages, resolves #1380
This commit is contained in:
Alexander Holliday
2024-12-17 07:28:35 -08:00
committed by GitHub
2 changed files with 4 additions and 0 deletions
@@ -135,6 +135,8 @@ const PageSpeedConfigure = () => {
if (pausePageSpeed.fulfilled.match(action)) {
const monitor = action.payload.data;
setMonitor(monitor);
const state = action?.payload?.data.isActive === false ? "paused" : "resumed";
createToast({ body: `Monitor ${state} successfully.` });
} else if (pausePageSpeed.rejected.match(action)) {
throw new Error(action.error.message);
}
@@ -141,6 +141,8 @@ const Configure = () => {
if (pauseUptimeMonitor.fulfilled.match(action)) {
const monitor = action.payload.data;
setMonitor(monitor);
const state = action?.payload?.data.isActive === false ? "paused" : "resumed";
createToast({ body: `Monitor ${state} successfully.` });
} else if (pauseUptimeMonitor.rejected.match(action)) {
throw new Error(action.error.message);
}