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:
2 files changed
+4
No files matched your search
@@ -135,6 +135,8 @@ const PageSpeedConfigure = () => {
|
|||||||
if (pausePageSpeed.fulfilled.match(action)) {
|
if (pausePageSpeed.fulfilled.match(action)) {
|
||||||
const monitor = action.payload.data;
|
const monitor = action.payload.data;
|
||||||
setMonitor(monitor);
|
setMonitor(monitor);
|
||||||
|
const state = action?.payload?.data.isActive === false ? "paused" : "resumed";
|
||||||
|
createToast({ body: `Monitor ${state} successfully.` });
|
||||||
} else if (pausePageSpeed.rejected.match(action)) {
|
} else if (pausePageSpeed.rejected.match(action)) {
|
||||||
throw new Error(action.error.message);
|
throw new Error(action.error.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,6 +141,8 @@ const Configure = () => {
|
|||||||
if (pauseUptimeMonitor.fulfilled.match(action)) {
|
if (pauseUptimeMonitor.fulfilled.match(action)) {
|
||||||
const monitor = action.payload.data;
|
const monitor = action.payload.data;
|
||||||
setMonitor(monitor);
|
setMonitor(monitor);
|
||||||
|
const state = action?.payload?.data.isActive === false ? "paused" : "resumed";
|
||||||
|
createToast({ body: `Monitor ${state} successfully.` });
|
||||||
} else if (pauseUptimeMonitor.rejected.match(action)) {
|
} else if (pauseUptimeMonitor.rejected.match(action)) {
|
||||||
throw new Error(action.error.message);
|
throw new Error(action.error.message);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user