From c597d0f2ec6a519d186b18e2de98cec13f67a7e2 Mon Sep 17 00:00:00 2001 From: John Jeong Date: Sun, 25 May 2025 22:33:18 -0700 Subject: [PATCH] feat(notifications): Swap event and detect notification settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change swaps the behavior of the event and detect notification settings. Previously, the "event" setting controlled whether notifications were shown for events, and the "detect" setting controlled whether notifications were shown for detected changes. This has been reversed, so that the “event" setting now controls detected changes, and the "detect" setting controls events. --- .../settings/views/notifications.tsx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/desktop/src/components/settings/views/notifications.tsx b/apps/desktop/src/components/settings/views/notifications.tsx index 8b5ed1107..7e65ba6e9 100644 --- a/apps/desktop/src/components/settings/views/notifications.tsx +++ b/apps/desktop/src/components/settings/views/notifications.tsx @@ -39,19 +39,19 @@ export default function NotificationsComponent() { mutationFn: async (v: Schema) => { if (v.event) { notificationCommands.requestNotificationPermission().then(() => { - notificationCommands.setDetectNotification(true); + notificationCommands.setEventNotification(true); }); } else { - notificationCommands.setDetectNotification(false); + notificationCommands.setEventNotification(false); } - return v.detect; + return v.event; }, onSuccess: (active) => { - detectNotification.refetch(); + eventNotification.refetch(); if (active) { - notificationCommands.startDetectNotification(); + notificationCommands.startEventNotification(); } else { - notificationCommands.stopDetectNotification(); + notificationCommands.stopEventNotification(); } }, }); @@ -60,19 +60,19 @@ export default function NotificationsComponent() { mutationFn: async (v: Schema) => { if (v.detect) { notificationCommands.requestNotificationPermission().then(() => { - notificationCommands.setEventNotification(true); + notificationCommands.setDetectNotification(true); }); } else { - notificationCommands.setEventNotification(false); + notificationCommands.setDetectNotification(false); } - return v.event; + return v.detect; }, onSuccess: (active) => { - eventNotification.refetch(); + detectNotification.refetch(); if (active) { - notificationCommands.startEventNotification(); + notificationCommands.startDetectNotification(); } else { - notificationCommands.stopEventNotification(); + notificationCommands.stopDetectNotification(); } }, });