chore: upgrade i18next 26, prettier 3, fontsource-variable, domhandler 6, lint-staged 17
- i18next 23->26 + react-i18next 15->17 - prettier 2->3, reformat all files - replace @fontsource/inter with @fontsource-variable/inter 5, update import path - domhandler 5->6 (aligns with transitive deps) - lint-staged 16->17
This commit is contained in:
@@ -18,7 +18,7 @@ import { useMatrixClient } from '../../../hooks/useMatrixClient';
|
||||
const getAllMessageDefaultRule = (
|
||||
ruleId: RuleId,
|
||||
encrypted: boolean,
|
||||
oneToOne: boolean
|
||||
oneToOne: boolean,
|
||||
): PushRuleData => {
|
||||
const conditions: PushRuleCondition[] = [];
|
||||
if (oneToOne)
|
||||
@@ -66,7 +66,7 @@ function AllMessagesModeSwitcher({
|
||||
const actions = getModeActions(mode);
|
||||
await mx.setPushRuleActions('global', kind, ruleId, actions);
|
||||
},
|
||||
[mx, getModeActions, kind, ruleId]
|
||||
[mx, getModeActions, kind, ruleId],
|
||||
);
|
||||
|
||||
return <NotificationModeSwitcher pushRule={pushRule} onChange={handleChange} />;
|
||||
@@ -76,7 +76,7 @@ export function AllMessagesNotifications() {
|
||||
const pushRulesEvt = useAccountData(AccountDataEvent.PushRules);
|
||||
const pushRules = useMemo(
|
||||
() => pushRulesEvt?.getContent<IPushRules>() ?? { global: {} },
|
||||
[pushRulesEvt]
|
||||
[pushRulesEvt],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -33,8 +33,8 @@ function KeywordInput() {
|
||||
});
|
||||
setKeyword('');
|
||||
},
|
||||
[mx]
|
||||
)
|
||||
[mx],
|
||||
),
|
||||
);
|
||||
const addingKeyword = keywordState.status === AsyncStatus.Loading;
|
||||
|
||||
@@ -114,8 +114,8 @@ function KeywordCross({ pushRule }: PushRulesProps) {
|
||||
const [removeState, remove] = useAsyncCallback(
|
||||
useCallback(
|
||||
() => mx.deletePushRule('global', PushRuleKind.ContentSpecific, pushRule.rule_id),
|
||||
[mx, pushRule]
|
||||
)
|
||||
[mx, pushRule],
|
||||
),
|
||||
);
|
||||
|
||||
const removing = removeState.status === AsyncStatus.Loading;
|
||||
@@ -145,10 +145,10 @@ function KeywordModeSwitcher({ pushRule }: PushRulesProps) {
|
||||
'global',
|
||||
PushRuleKind.ContentSpecific,
|
||||
pushRule.rule_id,
|
||||
actions
|
||||
actions,
|
||||
);
|
||||
},
|
||||
[mx, getModeActions, pushRule]
|
||||
[mx, getModeActions, pushRule],
|
||||
);
|
||||
|
||||
return <NotificationModeSwitcher pushRule={pushRule} onChange={handleChange} />;
|
||||
@@ -158,13 +158,13 @@ export function KeywordMessagesNotifications() {
|
||||
const pushRulesEvt = useAccountData(AccountDataEvent.PushRules);
|
||||
const pushRules = useMemo(
|
||||
() => pushRulesEvt?.getContent<IPushRules>() ?? { global: {} },
|
||||
[pushRulesEvt]
|
||||
[pushRulesEvt],
|
||||
);
|
||||
|
||||
const keywordPushRules = useMemo(() => {
|
||||
const content = pushRules.global.content ?? [];
|
||||
return content.filter(
|
||||
(pushRule) => pushRule.default === false && typeof pushRule.pattern === 'string'
|
||||
(pushRule) => pushRule.default === false && typeof pushRule.pattern === 'string',
|
||||
);
|
||||
}, [pushRules]);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ const useNotificationModeStr = (): Record<NotificationMode, string> =>
|
||||
[NotificationMode.Notify]: 'Notify Silent',
|
||||
[NotificationMode.NotifyLoud]: 'Notify Loud',
|
||||
}),
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
type NotificationModeSwitcherProps = {
|
||||
|
||||
@@ -32,7 +32,7 @@ const getDefaultIsUserMention = (userId: string): PushRuleData =>
|
||||
key: 'content.m\\.mentions.user_ids',
|
||||
value: userId,
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
const DefaultContainsDisplayName = makePushRuleData(
|
||||
@@ -43,7 +43,7 @@ const DefaultContainsDisplayName = makePushRuleData(
|
||||
{
|
||||
kind: ConditionKind.ContainsDisplayName,
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
const getDefaultContainsUsername = (username: string) =>
|
||||
@@ -52,7 +52,7 @@ const getDefaultContainsUsername = (username: string) =>
|
||||
RuleId.ContainsUserName,
|
||||
getNotificationModeActions(NotificationMode.NotifyLoud, { highlight: true }),
|
||||
undefined,
|
||||
username
|
||||
username,
|
||||
);
|
||||
|
||||
const DefaultIsRoomMention = makePushRuleData(
|
||||
@@ -69,7 +69,7 @@ const DefaultIsRoomMention = makePushRuleData(
|
||||
kind: ConditionKind.SenderNotificationPermission,
|
||||
key: 'room',
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
const DefaultAtRoomNotification = makePushRuleData(
|
||||
@@ -86,7 +86,7 @@ const DefaultAtRoomNotification = makePushRuleData(
|
||||
kind: ConditionKind.SenderNotificationPermission,
|
||||
key: 'room',
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
type PushRulesProps = {
|
||||
@@ -105,7 +105,7 @@ function MentionModeSwitcher({ ruleId, pushRules, defaultPushRuleData }: PushRul
|
||||
const actions = getModeActions(mode);
|
||||
await mx.setPushRuleActions('global', kind, ruleId, actions);
|
||||
},
|
||||
[mx, getModeActions, kind, ruleId]
|
||||
[mx, getModeActions, kind, ruleId],
|
||||
);
|
||||
|
||||
return <NotificationModeSwitcher pushRule={pushRule} onChange={handleChange} />;
|
||||
@@ -118,7 +118,7 @@ export function SpecialMessagesNotifications() {
|
||||
const pushRulesEvt = useAccountData(AccountDataEvent.PushRules);
|
||||
const pushRules = useMemo(
|
||||
() => pushRulesEvt?.getContent<IPushRules>() ?? { global: {} },
|
||||
[pushRulesEvt]
|
||||
[pushRulesEvt],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -39,8 +39,8 @@ function EmailNotification() {
|
||||
kind: null,
|
||||
} as unknown as IPusherRequest);
|
||||
},
|
||||
[mx]
|
||||
)
|
||||
[mx],
|
||||
),
|
||||
);
|
||||
|
||||
const handleChange = (value: boolean) => {
|
||||
@@ -89,7 +89,7 @@ export function SystemNotification() {
|
||||
const [showNotifications, setShowNotifications] = useSetting(settingsAtom, 'showNotifications');
|
||||
const [isNotificationSounds, setIsNotificationSounds] = useSetting(
|
||||
settingsAtom,
|
||||
'isNotificationSounds'
|
||||
'isNotificationSounds',
|
||||
);
|
||||
|
||||
const requestNotificationPermission = () => {
|
||||
|
||||
Reference in New Issue
Block a user