switch conditional values for state variable
This commit is contained in:
1 parent
7ace30e678
commit
e87c057ccb
2 files changed
+2
-2
No files matched your search
@@ -136,7 +136,7 @@ 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";
|
const state = action?.payload?.data.isActive === false ? "resumed" : "paused";
|
||||||
createToast({ body: `Monitor ${state} successfully.` });
|
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);
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ 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";
|
const state = action?.payload?.data.isActive === false ? "resumed" : "paused";
|
||||||
createToast({ body: `Monitor ${state} successfully.` });
|
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