Fix the mechanical style rules. [skip build]

This commit is contained in:
2026-11-01 09:01:32 +11:00
parent 831ce01150
commit 9591d8d01b
42 changed files with 762 additions and 756 deletions
+27 -27
View File
@@ -569,35 +569,35 @@ function AndroidShareIntentHandler() {
// Upload file
const uploadResult = await mx.uploadContent(fileToUpload);
const mxc = uploadResult?.content_uri;
if (!mxc) continue;
if (mxc) {
// Determine message type and send
const fileType = originalFile.type;
let msgtype = 'm.file' as const;
if (fileType.startsWith('image/')) msgtype = 'm.image' as const;
else if (fileType.startsWith('video/')) msgtype = 'm.video' as const;
else if (fileType.startsWith('audio/')) msgtype = 'm.audio' as const;
// Determine message type and send
const fileType = originalFile.type;
let msgtype = 'm.file' as const;
if (fileType.startsWith('image/')) msgtype = 'm.image' as const;
else if (fileType.startsWith('video/')) msgtype = 'm.video' as const;
else if (fileType.startsWith('audio/')) msgtype = 'm.audio' as const;
const fileContent: any = {
msgtype,
body: originalFile.name,
filename: originalFile.name,
info: {
mimetype: originalFile.type,
size: originalFile.size,
},
};
if (encInfo) {
fileContent.file = {
...encInfo,
url: mxc,
const fileContent: any = {
msgtype,
body: originalFile.name,
filename: originalFile.name,
info: {
mimetype: originalFile.type,
size: originalFile.size,
},
};
} else {
fileContent.url = mxc;
}
await mx.sendMessage(roomId, fileContent);
if (encInfo) {
fileContent.file = {
...encInfo,
url: mxc,
};
} else {
fileContent.url = mxc;
}
await mx.sendMessage(roomId, fileContent);
}
}
}
@@ -645,7 +645,7 @@ function AndroidShareIntentHandler() {
}, []);
useEffect(() => {
if (!isAndroidShareSupported()) return;
if (!isAndroidShareSupported()) return undefined;
let mounted = true;
let listenerHandle: { remove: () => Promise<void> } | undefined;
+4 -4
View File
@@ -51,7 +51,7 @@ const useLogoutListener = (mx?: MatrixClient) => {
*/
const useVisibilitySync = (mx?: MatrixClient) => {
useEffect(() => {
if (!mx || !isTauriMobile()) return;
if (!mx || !isTauriMobile()) return undefined;
const handleVisibilityChange = () => {
if (document.visibilityState === 'visible') {
@@ -96,7 +96,7 @@ const useVisibilitySync = (mx?: MatrixClient) => {
*/
const useBackgroundSync = (mx?: MatrixClient) => {
useEffect(() => {
if (!mx || !isTauriMobile()) return;
if (!mx || !isTauriMobile()) return undefined;
// Start background sync with credentials from the Matrix client
const startSync = async () => {
@@ -298,7 +298,7 @@ export function ClientRoot({ children }: ClientRootProps) {
// Timeout if sync takes too long - nudge the client rather than immediately erroring
useEffect(() => {
if (!mx || !loading) return;
if (!mx || !loading) return undefined;
const timeout = setTimeout(() => {
console.warn('[ClientRoot] Sync taking too long, nudging client...');
@@ -394,7 +394,7 @@ export function ClientRoot({ children }: ClientRootProps) {
// Also nudge sync when the laptop wakes / network returns
useEffect(() => {
if (!mx) return;
if (!mx) return undefined;
const nudge = () => {
if (document.visibilityState !== 'visible') return;