Type the updater API and the Tauri global. [skip build]
Checks / checks (push) Successful in 2m7s
Trigger cinny-mobile / dispatch (push) Successful in 1s

This commit is contained in:
2026-11-01 22:36:44 +11:00
parent 3781b05f6f
commit 027dbee1f1
7 changed files with 63 additions and 47 deletions
+8 -7
View File
@@ -8,6 +8,7 @@ import {
MatrixEvent,
Room,
IPushRules,
IPushRule,
SyncState,
} from 'matrix-js-sdk';
import { useAtomValue } from 'jotai';
@@ -113,8 +114,8 @@ export function TitleBar({ mx, children }: TitleBarProps) {
const pushRules = pushRulesEvt?.getContent<IPushRules>() ?? { global: {} };
const content = pushRules.global.content ?? [];
const keywordPatterns = content
.filter((rule: any) => rule.default === false && typeof rule.pattern === 'string')
.map((rule: any) => rule.pattern as string);
.filter((rule: IPushRule) => rule.default === false && typeof rule.pattern === 'string')
.map((rule: IPushRule) => rule.pattern as string);
// Get notification preferences
const global = pushRules?.global;
@@ -128,21 +129,21 @@ export function TitleBar({ mx, children }: TitleBarProps) {
};
// Check override rules for muted rooms
override.forEach((rule: any) => {
override.forEach((rule: IPushRule) => {
if (isRoomId(rule.rule_id) && getNotificationMode(rule.actions) === NotificationMode.OFF) {
preferences.mute.add(rule.rule_id);
}
});
// Check room rules for special messages (OFF mode = mentions only)
room.forEach((rule: any) => {
room.forEach((rule: IPushRule) => {
if (getNotificationMode(rule.actions) === NotificationMode.OFF) {
preferences.specialMessages.add(rule.rule_id);
}
});
// Check room rules for all messages (Notify or NotifyLoud mode)
room.forEach((rule: any) => {
room.forEach((rule: IPushRule) => {
if (getNotificationMode(rule.actions) !== NotificationMode.OFF) {
preferences.allMessages.add(rule.rule_id);
}
@@ -483,7 +484,7 @@ export function TitleBar({ mx, children }: TitleBarProps) {
const content = event.getContent();
const isMyReceipt = Object.keys(content).find((eventId) =>
(Object.keys(content[eventId]) as any[]).find(
Object.keys(content[eventId]).find(
(receiptType) => content[eventId][receiptType][myUserId],
),
);
@@ -631,7 +632,7 @@ export function TitleBar({ mx, children }: TitleBarProps) {
};
// Only render on desktop (when Tauri is available)
if (typeof (window as any).__TAURI__ === 'undefined') {
if (typeof window.__TAURI__ === 'undefined') {
return null;
}