From ac7c2983d370db27c8e1c5b14469ccae443e6737 Mon Sep 17 00:00:00 2001 From: fallenbagel <98979876+fallenbagel@users.noreply.github.com> Date: Sat, 17 Jan 2026 02:39:15 +0500 Subject: [PATCH] fix(pushover): prevent notifications when agent is disabled or unconfigured (#2304) --- server/lib/notifications/agents/pushover.ts | 12 +++++++++++- .../Notifications/NotificationsPushover/index.tsx | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/server/lib/notifications/agents/pushover.ts b/server/lib/notifications/agents/pushover.ts index c95b1d06..838c205a 100644 --- a/server/lib/notifications/agents/pushover.ts +++ b/server/lib/notifications/agents/pushover.ts @@ -45,7 +45,17 @@ class PushoverAgent } public shouldSend(): boolean { - return true; + const settings = this.getSettings(); + + if ( + settings.enabled && + settings.options.accessToken && + settings.options.userToken + ) { + return true; + } + + return false; } private async getImagePayload( diff --git a/src/components/Settings/Notifications/NotificationsPushover/index.tsx b/src/components/Settings/Notifications/NotificationsPushover/index.tsx index c772d7a3..ded52f18 100644 --- a/src/components/Settings/Notifications/NotificationsPushover/index.tsx +++ b/src/components/Settings/Notifications/NotificationsPushover/index.tsx @@ -49,7 +49,12 @@ const NotificationsPushover = () => { const { data: soundsData } = useSWR( data?.options.accessToken ? `/api/v1/settings/notifications/pushover/sounds?token=${data.options.accessToken}` - : null + : null, + { + revalidateOnFocus: false, + revalidateOnReconnect: false, + shouldRetryOnError: false, + } ); const NotificationsPushoverSchema = Yup.object().shape({