From 4b47d43cd1b54467a2e96e93dd3eb107a7ffad1e Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 13 Dec 2024 13:12:38 +0800 Subject: [PATCH] Add pause toast to PageSpeed and Uptime configure pages --- Client/src/Pages/PageSpeed/Configure/index.jsx | 2 ++ Client/src/Pages/Uptime/Configure/index.jsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Client/src/Pages/PageSpeed/Configure/index.jsx b/Client/src/Pages/PageSpeed/Configure/index.jsx index 47d847394..0c94678d2 100644 --- a/Client/src/Pages/PageSpeed/Configure/index.jsx +++ b/Client/src/Pages/PageSpeed/Configure/index.jsx @@ -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); } diff --git a/Client/src/Pages/Uptime/Configure/index.jsx b/Client/src/Pages/Uptime/Configure/index.jsx index 95af3ad76..0d7388d14 100644 --- a/Client/src/Pages/Uptime/Configure/index.jsx +++ b/Client/src/Pages/Uptime/Configure/index.jsx @@ -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); }