From a02a10eda117b9a4d4353cf70dba221b1c591107 Mon Sep 17 00:00:00 2001 From: Gigiaj Date: Tue, 10 Jun 2025 17:43:18 -0500 Subject: [PATCH] adjust to reflect using the service worker to actually toggle --- .../notifications/PushNotifications.tsx | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/app/features/settings/notifications/PushNotifications.tsx b/src/app/features/settings/notifications/PushNotifications.tsx index f3f6205c..6b02e7c0 100644 --- a/src/app/features/settings/notifications/PushNotifications.tsx +++ b/src/app/features/settings/notifications/PushNotifications.tsx @@ -177,9 +177,8 @@ export async function togglePusher( const { pushers } = await mx.getPushers(); const existingPusher = pushers.find((p) => p.pushkey === p256dhKey); - if (existingPusher && existingPusher.kind === 'http') { - if (visible) { - /* + if (visible) { + /* Need to clean up the old push rules I made The push rules should be removed upon roomId change and a new one added for the NEW current room @@ -203,22 +202,8 @@ export async function togglePusher( Instead we'll do a hackier bypass, but only Cinny will acknowledge this as the client is responsible for handling the sounds themselves. This is more or less a custom tweak still. */ - mx.addPushRule('global', PushRuleKind.Override, `${MUTE_RULE_ID}`, { - conditions: [], - actions: [ - PushRuleActionName.DontNotify, - { - set_tweak: TweakName.Sound, - value: 'cinny_show_banner', - }, - { - set_tweak: TweakName.Highlight, - value: true, - }, - ], - }); - } else { - await mx.deletePushRule('global', PushRuleKind.Override, `${MUTE_RULE_ID}`); - } + disablePushNotifications(mx, clientConfig); + } else { + enablePushNotifications(mx, clientConfig); } }