From a3a8655487b5aa5fd302d18438e728774b527a54 Mon Sep 17 00:00:00 2001 From: heaven Date: Thu, 4 Jun 2026 01:22:20 +0300 Subject: [PATCH] refactor(notifications): simplify keywords to add/remove, dropping the per-keyword loudness control --- .../notifications/KeywordMessages.tsx | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/src/app/features/settings/notifications/KeywordMessages.tsx b/src/app/features/settings/notifications/KeywordMessages.tsx index 6404af75..ff84ce56 100644 --- a/src/app/features/settings/notifications/KeywordMessages.tsx +++ b/src/app/features/settings/notifications/KeywordMessages.tsx @@ -12,9 +12,7 @@ import { getNotificationModeActions, NotificationMode, NotificationModeOptions, - useNotificationModeActions, } from '../../../hooks/useNotificationMode'; -import { NotificationModeSwitcher } from './NotificationModeSwitcher'; import { AsyncStatus, useAsyncCallback } from '../../../hooks/useAsyncCallback'; const NOTIFY_MODE_OPS: NotificationModeOptions = { @@ -126,27 +124,6 @@ function KeywordCross({ pushRule }: PushRulesProps) { ); } -function KeywordModeSwitcher({ pushRule }: PushRulesProps) { - const mx = useMatrixClient(); - - const getModeActions = useNotificationModeActions(NOTIFY_MODE_OPS); - - const handleChange = useCallback( - async (mode: NotificationMode) => { - const actions = getModeActions(mode); - await mx.setPushRuleActions( - 'global', - PushRuleKind.ContentSpecific, - pushRule.rule_id, - actions - ); - }, - [mx, getModeActions, pushRule] - ); - - return ; -} - export function KeywordMessagesNotifications() { const { t } = useTranslation(); const pushRulesEvt = useAccountData(AccountDataEvent.PushRules); @@ -179,7 +156,6 @@ export function KeywordMessagesNotifications() { } before={} - after={} /> ))}