Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
Checks / checks (push) Successful in 2m11s
Trigger cinny-mobile / dispatch (push) Successful in 1s

This commit is contained in:
2026-11-01 04:23:53 +11:00
parent 3cd159a63e
commit a6ad8651b3
605 changed files with 11480 additions and 9125 deletions
@@ -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 (
@@ -34,8 +34,8 @@ function KeywordInput() {
});
setKeyword('');
},
[mx]
)
[mx],
),
);
const addingKeyword = keywordState.status === AsyncStatus.Loading;
@@ -113,8 +113,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;
@@ -137,10 +137,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} />;
@@ -150,13 +150,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]);
@@ -1,8 +1,8 @@
import { Box, Button, config, Menu, MenuItem, PopOut, RectCords, Spinner, Text } from 'folds';
import { Icon, Icons } from '../../../components/icons';
import { IPushRule } from 'matrix-js-sdk';
import React, { MouseEventHandler, useMemo, useState } from 'react';
import FocusTrap from 'focus-trap-react';
import { Icon, Icons } from '../../../components/icons';
import { NotificationMode, useNotificationActionsMode } from '../../../hooks/useNotificationMode';
import { stopPropagation } from '../../../utils/keyboard';
import { AsyncStatus, useAsyncCallback } from '../../../hooks/useAsyncCallback';
@@ -17,7 +17,7 @@ const useNotificationModeStr = (): Record<NotificationMode, string> =>
[NotificationMode.Notify]: 'Notify Silent',
[NotificationMode.NotifyLoud]: 'Notify Loud',
}),
[]
[],
);
type NotificationModeSwitcherProps = {
@@ -46,9 +46,7 @@ export function Notifications({ requestClose }: NotificationsProps) {
direction="Column"
gap="400"
>
<SettingTile
description={'This option has been moved to "Account > Block Users" section.'}
/>
<SettingTile description='This option has been moved to "Account > Block Users" section.' />
</SequenceCard>
</Box>
</Box>
@@ -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 (
@@ -46,8 +46,8 @@ function EmailNotification() {
kind: null,
} as unknown as IPusherRequest);
},
[mx]
)
[mx],
),
);
const handleChange = (value: boolean) => {
@@ -97,7 +97,7 @@ export function SystemNotification() {
const [showNotifications, setShowNotifications] = useSetting(settingsAtom, 'showNotifications');
const [isNotificationSounds, setIsNotificationSounds] = useSetting(
settingsAtom,
'isNotificationSounds'
'isNotificationSounds',
);
const requestNotificationPermission = async () => {
@@ -199,7 +199,7 @@ function AndroidPushNotifications() {
lastFailure: s.lastFailure || '',
autoStartBlocked: Boolean(s.autoStartBlocked),
}
: undefined
: undefined,
);
setLoading(false);
}, []);
@@ -215,16 +215,16 @@ function AndroidPushNotifications() {
await refresh();
if (!result.success) {
setLastError(
'Selected distributor but did not get a push endpoint. In ntfy: enable UnifiedPush, allow unrestricted battery, then try Reset again.'
'Selected distributor but did not get a push endpoint. In ntfy: enable UnifiedPush, allow unrestricted battery, then try Reset again.',
);
}
}, [refresh])
}, [refresh]),
);
const [pingState, ping] = useAsyncCallback(
useCallback(async () => {
await triggerBackgroundSyncPing('manual-test');
}, [])
}, []),
);
const isBusy =
@@ -251,7 +251,8 @@ function AndroidPushNotifications() {
if (status.lastFailure === 'AUTO_START_BLOCKED' || status.autoStartBlocked) {
return (
<Text as="span" style={{ color: color.Critical.Main }} size="T200">
Phone is blocking auto-start for Paarrot. Open App Boot / Auto-start settings, allow Paarrot (and ntfy), then tap Reset.
Phone is blocking auto-start for Paarrot. Open App Boot / Auto-start settings, allow
Paarrot (and ntfy), then tap Reset.
</Text>
);
}
@@ -265,7 +266,8 @@ function AndroidPushNotifications() {
if (status.distributors.length === 0) {
return (
<Text as="span" style={{ color: color.Critical.Main }} size="T200">
No UnifiedPush distributor found. Install ntfy from Play Store/F-Droid and enable UnifiedPush in ntfy settings.
No UnifiedPush distributor found. Install ntfy from Play Store/F-Droid and enable
UnifiedPush in ntfy settings.
</Text>
);
}
@@ -291,7 +293,11 @@ function AndroidPushNotifications() {
<>
{statusDescription}
{lastError ? (
<Text as="span" style={{ color: color.Critical.Main, display: 'block' }} size="T200">
<Text
as="span"
style={{ color: color.Critical.Main, display: 'block' }}
size="T200"
>
{lastError}
</Text>
) : null}