chore: upgrade i18next 26, prettier 3, fontsource-variable, domhandler 6, lint-staged 17
CI / Build & Quality Checks (push) Successful in 10m13s
CI / Build & Quality Checks (push) Successful in 10m13s
- 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:
+11
-11
@@ -43,7 +43,7 @@ export const getCanonicalAliasRoomId = (mx: MatrixClient, alias: string): string
|
||||
?.find(
|
||||
(room) =>
|
||||
room.getCanonicalAlias() === alias &&
|
||||
getStateEvent(room, StateEvent.RoomTombstone) === undefined
|
||||
getStateEvent(room, StateEvent.RoomTombstone) === undefined,
|
||||
)?.roomId;
|
||||
|
||||
export const getCanonicalAliasOrRoomId = (mx: MatrixClient, roomId: string): string => {
|
||||
@@ -105,7 +105,7 @@ export const getThumbnailContent = (thumbnailInfo: {
|
||||
};
|
||||
|
||||
export const encryptFile = async (
|
||||
file: File | Blob
|
||||
file: File | Blob,
|
||||
): Promise<{
|
||||
encInfo: EncryptedAttachmentInfo;
|
||||
file: File;
|
||||
@@ -126,7 +126,7 @@ export const encryptFile = async (
|
||||
export const decryptFile = async (
|
||||
dataBuffer: ArrayBuffer,
|
||||
type: string,
|
||||
encInfo: EncryptedAttachmentInfo
|
||||
encInfo: EncryptedAttachmentInfo,
|
||||
): Promise<Blob> => {
|
||||
const dataArray = await decryptAttachment(dataBuffer, encInfo);
|
||||
const blob = new Blob([dataArray], { type });
|
||||
@@ -148,7 +148,7 @@ export type ContentUploadOptions = {
|
||||
export const uploadContent = async (
|
||||
mx: MatrixClient,
|
||||
file: TUploadContent,
|
||||
options: ContentUploadOptions
|
||||
options: ContentUploadOptions,
|
||||
) => {
|
||||
const { name, fileType, hideFilename, onProgress, onPromise, onSuccess, onError } = options;
|
||||
|
||||
@@ -186,7 +186,7 @@ export const getDMRoomFor = (mx: MatrixClient, userId: string): Room | undefined
|
||||
(room) =>
|
||||
room.getMyMembership() === Membership.Join &&
|
||||
room.hasEncryptionStateEvent() &&
|
||||
room.getMembers().length <= 2
|
||||
room.getMembers().length <= 2,
|
||||
);
|
||||
|
||||
return dmLikeRooms.find((room) => room.getMember(userId));
|
||||
@@ -220,7 +220,7 @@ export const guessDmRoomUserId = (room: Room, myUserId: string): string => {
|
||||
|
||||
// if there are no joined members other than us, use the oldest member
|
||||
const member1 = getOldestMember(
|
||||
room.getLiveTimeline().getState(EventTimeline.FORWARDS)?.getMembers() ?? []
|
||||
room.getLiveTimeline().getState(EventTimeline.FORWARDS)?.getMembers() ?? [],
|
||||
);
|
||||
return member1?.userId ?? myUserId;
|
||||
};
|
||||
@@ -228,7 +228,7 @@ export const guessDmRoomUserId = (room: Room, myUserId: string): string => {
|
||||
export const addRoomIdToMDirect = async (
|
||||
mx: MatrixClient,
|
||||
roomId: string,
|
||||
userId: string
|
||||
userId: string,
|
||||
): Promise<void> => {
|
||||
const mDirectsEvent = mx.getAccountData(AccountDataEvent.Direct as any);
|
||||
let userIdToRoomIds: Record<string, string[]> = {};
|
||||
@@ -284,7 +284,7 @@ export const mxcUrlToHttp = (
|
||||
height?: number,
|
||||
resizeMethod?: string,
|
||||
allowDirectLinks?: boolean,
|
||||
allowRedirects?: boolean
|
||||
allowRedirects?: boolean,
|
||||
): string | null =>
|
||||
mx.mxcUrlToHttp(
|
||||
mxcUrl,
|
||||
@@ -293,7 +293,7 @@ export const mxcUrlToHttp = (
|
||||
resizeMethod,
|
||||
allowDirectLinks,
|
||||
allowRedirects,
|
||||
useAuthentication
|
||||
useAuthentication,
|
||||
);
|
||||
|
||||
export const downloadMedia = async (src: string): Promise<Blob> => {
|
||||
@@ -305,7 +305,7 @@ export const downloadMedia = async (src: string): Promise<Blob> => {
|
||||
|
||||
export const downloadEncryptedMedia = async (
|
||||
src: string,
|
||||
decryptContent: (buf: ArrayBuffer) => Promise<Blob>
|
||||
decryptContent: (buf: ArrayBuffer) => Promise<Blob>,
|
||||
): Promise<Blob> => {
|
||||
const encryptedContent = await downloadMedia(src);
|
||||
const decryptedContent = await decryptContent(await encryptedContent.arrayBuffer());
|
||||
@@ -316,7 +316,7 @@ export const downloadEncryptedMedia = async (
|
||||
export const rateLimitedActions = async <T, R = void>(
|
||||
data: T[],
|
||||
callback: (item: T, index: number) => Promise<R>,
|
||||
maxRetryCount?: number
|
||||
maxRetryCount?: number,
|
||||
) => {
|
||||
let retryCount = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user