Type the crypto, settings, and component any sites. [skip build]
Checks / checks (push) Successful in 2m4s
Trigger cinny-mobile / dispatch (push) Successful in 2s

This commit is contained in:
2026-11-02 03:56:07 +11:00
parent 6c8a085ae1
commit 9d17b14a9e
26 changed files with 68 additions and 49 deletions
@@ -30,7 +30,7 @@ function makeUIAAction<T>(
authData: IAuthData,
performAction: PerformAction<T>,
resolve: (data: T) => void,
reject: (error?: any) => void,
reject: (error?: unknown) => void,
): UIAAction<T> {
const action: UIAAction<T> = {
authData,
+9 -2
View File
@@ -1,6 +1,7 @@
import React, { FormEventHandler, useCallback } from 'react';
import { Box, Text, Button, Spinner, color } from 'folds';
import { decodeRecoveryKey, deriveRecoveryKeyFromPassphrase } from 'matrix-js-sdk/lib/crypto-api';
import { SecretStorageKeyDescriptionAesV1 } from 'matrix-js-sdk/lib/secret-storage';
import { PasswordInput } from './password-input';
import {
SecretStorageKeyContent,
@@ -39,7 +40,10 @@ export function SecretStorageRecoveryPassphrase({
bits,
);
const match = await mx.secretStorage.checkKey(decodedRecoveryKey, keyContent as any);
const match = await mx.secretStorage.checkKey(
decodedRecoveryKey,
keyContent as SecretStorageKeyDescriptionAesV1,
);
if (!match) {
throw new Error('Invalid recovery passphrase.');
@@ -131,7 +135,10 @@ export function SecretStorageRecoveryKey({
async (recoveryKey) => {
const decodedRecoveryKey = decodeRecoveryKey(recoveryKey);
const match = await mx.secretStorage.checkKey(decodedRecoveryKey, keyContent as any);
const match = await mx.secretStorage.checkKey(
decodedRecoveryKey,
keyContent as SecretStorageKeyDescriptionAesV1,
);
if (!match) {
throw new Error('Invalid recovery key.');
@@ -68,12 +68,12 @@ const deleteAllMatrixDatabases = async (): Promise<void> => {
// Try to get all databases if the API is available
try {
if ('databases' in indexedDB) {
const allDbs = await (indexedDB as any).databases();
const allDbs = await indexedDB.databases();
const matrixDbs = allDbs
.map((db: any) => db.name)
.map((db) => db.name)
.filter(
(name: string) =>
name &&
(name): name is string =>
typeof name === 'string' &&
(name.startsWith('matrix-js-sdk') ||
name.includes('@@') ||
name.startsWith('sync@@') ||
+5 -4
View File
@@ -1,4 +1,5 @@
import {
EventType,
ICreateRoomOpts,
ICreateRoomStateEvent,
JoinRule,
@@ -6,7 +7,7 @@ import {
RestrictedAllowType,
Room,
} from 'matrix-js-sdk';
import { RoomJoinRulesEventContent } from 'matrix-js-sdk/lib/types';
import { RoomJoinRulesEventContent, SpaceChildEventContent } from 'matrix-js-sdk/lib/types';
import { CreateRoomKind } from './CreateRoomKindSelector';
import { RoomType, StateEvent } from '../../../types/matrix/room';
import { getViaServers } from '../../plugins/via-servers';
@@ -17,7 +18,7 @@ export const createRoomCreationContent = (
allowFederation: boolean,
additionalCreators: string[] | undefined,
): object => {
const content: Record<string, any> = {};
const content: Record<string, unknown> = {};
if (typeof type === 'string') {
content.type = type;
}
@@ -144,12 +145,12 @@ export const createRoom = async (mx: MatrixClient, data: CreateRoomData): Promis
if (data.parent) {
await mx.sendStateEvent(
data.parent.roomId,
StateEvent.SpaceChild as any,
EventType.SpaceChild,
{
auto_join: false,
suggested: false,
via: [getMxIdServer(mx.getUserId() ?? '') ?? ''],
},
} as SpaceChildEventContent,
result.room_id,
);
}
+4 -2
View File
@@ -8,8 +8,10 @@ import React, {
} from 'react';
import { Box, Scroll, Text } from 'folds';
import {
DecoratedRange,
Descendant,
Editor,
NodeEntry,
createEditor,
Element as SlateElement,
Text as SlateText,
@@ -122,8 +124,8 @@ export const CustomEditor = forwardRef<HTMLDivElement, CustomEditorProps>(
const renderLeaf = useCallback((props: RenderLeafProps) => <RenderLeaf {...props} />, []);
const decorate = useCallback(
([node, path]: [any, number[]]) => {
const ranges: any[] = [];
([node, path]: NodeEntry) => {
const ranges: (DecoratedRange & { pendingCommand?: boolean })[] = [];
// Only decorate text nodes in the first paragraph
if (path.length === 2 && path[0] === 0 && path[1] === 0 && SlateText.isText(node)) {
@@ -119,7 +119,7 @@ export function ReadTextFile({ body, mimeType, url, encInfo, renderViewer }: Rea
<Modal
className={ModalWide}
size="500"
onContextMenu={(evt: any) => evt.stopPropagation()}
onContextMenu={(evt) => evt.stopPropagation()}
>
{renderViewer({
name: body,
@@ -213,7 +213,7 @@ export function ReadPdfFile({ body, mimeType, url, encInfo, renderViewer }: Read
<Modal
className={ModalWide}
size="500"
onContextMenu={(evt: any) => evt.stopPropagation()}
onContextMenu={(evt) => evt.stopPropagation()}
>
{renderViewer({
name: body,
@@ -15,7 +15,7 @@ import {
Spinner,
toRem,
} from 'folds';
import { MatrixClient, MatrixError, Room } from 'matrix-js-sdk';
import { EventType, MatrixClient, MatrixError, Room } from 'matrix-js-sdk';
import { Icon, Icons } from '../icons';
import { useMatrixClient } from '../../hooks/useMatrixClient';
import { AsyncStatus, useAsyncCallback } from '../../hooks/useAsyncCallback';
@@ -134,7 +134,7 @@ async function removeSpaceChildrenSequentially(
onProgress?.(i, total);
try {
await mx.sendStateEvent(parentId, StateEvent.SpaceChild as any, {}, roomId);
await mx.sendStateEvent(parentId, EventType.SpaceChild, {}, roomId);
await delay(REMOVE_DELAY_MS);
} catch {
// Continue removing others even if one fails
@@ -49,7 +49,7 @@ export function WindowControls() {
};
// Only render on desktop (when Tauri is available)
if (typeof (window as any).__TAURI__ === 'undefined') {
if (typeof window.__TAURI__ === 'undefined') {
return null;
}