chore: upgrade i18next 26, prettier 3, fontsource-variable, domhandler 6, lint-staged 17
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:
Lotus Bot
2026-05-21 23:30:50 -04:00
parent 98fde12682
commit 23008670f3
363 changed files with 1443 additions and 1419 deletions
+11 -11
View File
@@ -14,7 +14,7 @@ const AuthLayout = React.lazy(() => import('./auth').then((m) => ({ default: m.A
const Login = React.lazy(() => import('./auth').then((m) => ({ default: m.Login })));
const Register = React.lazy(() => import('./auth').then((m) => ({ default: m.Register })));
const ResetPassword = React.lazy(() =>
import('./auth').then((m) => ({ default: m.ResetPassword }))
import('./auth').then((m) => ({ default: m.ResetPassword })),
);
import {
DIRECT_PATH,
@@ -64,33 +64,33 @@ import { AuthRouteThemeManager, UnAuthRouteThemeManager } from './ThemeManager';
import { ReceiveSelfDeviceVerification } from '../components/DeviceVerification';
import { AutoRestoreBackupOnVerification } from '../components/BackupRestore';
const RoomSettingsRenderer = React.lazy(() =>
import('../features/room-settings').then((m) => ({ default: m.RoomSettingsRenderer }))
import('../features/room-settings').then((m) => ({ default: m.RoomSettingsRenderer })),
);
import { ClientRoomsNotificationPreferences } from './client/ClientRoomsNotificationPreferences';
const SpaceSettingsRenderer = React.lazy(() =>
import('../features/space-settings').then((m) => ({ default: m.SpaceSettingsRenderer }))
import('../features/space-settings').then((m) => ({ default: m.SpaceSettingsRenderer })),
);
import { UserRoomProfileRenderer } from '../components/UserRoomProfileRenderer';
const CreateRoomModalRenderer = React.lazy(() =>
import('../features/create-room').then((m) => ({ default: m.CreateRoomModalRenderer }))
import('../features/create-room').then((m) => ({ default: m.CreateRoomModalRenderer })),
);
import { HomeCreateRoom } from './client/home/CreateRoom';
import { Create } from './client/create';
const CreateSpaceModalRenderer = React.lazy(() =>
import('../features/create-space').then((m) => ({ default: m.CreateSpaceModalRenderer }))
import('../features/create-space').then((m) => ({ default: m.CreateSpaceModalRenderer })),
);
const SearchModalRenderer = React.lazy(() =>
import('../features/search').then((m) => ({ default: m.SearchModalRenderer }))
import('../features/search').then((m) => ({ default: m.SearchModalRenderer })),
);
const Explore = React.lazy(() => import('./client/explore').then((m) => ({ default: m.Explore })));
const FeaturedRooms = React.lazy(() =>
import('./client/explore').then((m) => ({ default: m.FeaturedRooms }))
import('./client/explore').then((m) => ({ default: m.FeaturedRooms })),
);
const PublicRooms = React.lazy(() =>
import('./client/explore').then((m) => ({ default: m.PublicRooms }))
import('./client/explore').then((m) => ({ default: m.PublicRooms })),
);
const Notifications = React.lazy(() =>
import('./client/inbox').then((m) => ({ default: m.Notifications }))
import('./client/inbox').then((m) => ({ default: m.Notifications })),
);
const Inbox = React.lazy(() => import('./client/inbox').then((m) => ({ default: m.Inbox })));
const Invites = React.lazy(() => import('./client/inbox').then((m) => ({ default: m.Invites })));
@@ -161,7 +161,7 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize)
if (!session) {
const afterLoginPath = getAppPathFromHref(
getOriginBaseUrl(hashRouter),
window.location.href
window.location.href,
);
if (afterLoginPath) setAfterLoginRedirectPath(afterLoginPath);
return redirect(getLoginPath());
@@ -401,7 +401,7 @@ export const createRouter = (clientConfig: ClientConfig, screenSize: ScreenSize)
</Route>
</Route>
<Route path="/*" element={<p>Page not found</p>} />
</Route>
</Route>,
);
if (hashRouter?.enabled) {
+1 -1
View File
@@ -26,7 +26,7 @@ export function UnAuthRouteThemeManager() {
const isLight = systemThemeKind === ThemeKind.Light;
document.documentElement.setAttribute('data-theme', isLight ? 'light' : 'dark');
document.body.classList.add(
...(isLight ? LotusTerminalLightTheme : LotusTerminalTheme).classNames
...(isLight ? LotusTerminalLightTheme : LotusTerminalTheme).classNames,
);
document.body.classList.add(lotusTerminalBodyClass);
} else {
+4 -4
View File
@@ -86,7 +86,7 @@ export function AuthLayout() {
serverName,
response,
};
}, [])
}, []),
);
useEffect(() => {
@@ -100,7 +100,7 @@ export function AuthLayout() {
generatePath(currentAuthPath(location.pathname), {
server: encodeURIComponent(server),
}),
{ replace: true }
{ replace: true },
);
}
}, [urlEncodedServer, navigate, location, server]);
@@ -113,10 +113,10 @@ export function AuthLayout() {
return;
}
navigate(
generatePath(currentAuthPath(location.pathname), { server: encodeURIComponent(newServer) })
generatePath(currentAuthPath(location.pathname), { server: encodeURIComponent(newServer) }),
);
},
[navigate, location, discoveryState, server, discoverServer]
[navigate, location, discoveryState, server, discoverServer],
);
const [autoDiscoveryError, autoDiscoveryInfo] =
+1 -1
View File
@@ -19,7 +19,7 @@ export function SSOLogin({ providers, redirectUrl, action, saveScreenSpace }: SS
const withoutIcon = providers
? providers.find(
(provider) => !provider.icon || !mx.mxcUrlToHttp(provider.icon, 96, 96, 'crop', false)
(provider) => !provider.icon || !mx.mxcUrlToHttp(provider.icon, 96, 96, 'crop', false),
)
: true;
+2 -2
View File
@@ -31,7 +31,7 @@ const useLoginSearchParams = (searchParams: URLSearchParams): LoginPathSearchPar
email: searchParams.get('email') ?? undefined,
loginToken: searchParams.get('loginToken') ?? undefined,
}),
[searchParams]
[searchParams],
);
export function Login() {
@@ -48,7 +48,7 @@ export function Login() {
window.location.replace(
withSearchParam(absoluteLoginPath, {
loginToken: loginTokenForHashRouter,
})
}),
);
}
+1 -1
View File
@@ -59,7 +59,7 @@ export type CustomLoginResponse = {
};
export const login = async (
serverBaseUrl: string | (() => Promise<string>),
data: LoginRequest
data: LoginRequest,
): Promise<CustomLoginResponse> => {
const [urlError, url] =
typeof serverBaseUrl === 'function' ? await to(serverBaseUrl()) : [undefined, serverBaseUrl];
@@ -112,7 +112,7 @@ function RegisterUIAFlow({
initial_device_display_name: 'Lotus Chat Web',
});
},
[onRegister, formData]
[onRegister, formData],
);
const handleCancel = useCallback(() => {
+1 -1
View File
@@ -20,7 +20,7 @@ const useRegisterSearchParams = (searchParams: URLSearchParams): RegisterPathSea
email: searchParams.get('email') ?? undefined,
token: searchParams.get('token') ?? undefined,
}),
[searchParams]
[searchParams],
);
export function Register() {
+2 -2
View File
@@ -37,7 +37,7 @@ export type CustomRegisterResponse = {
export type RegisterResult = [IAuthData, undefined] | [undefined, CustomRegisterResponse];
export const register = async (
mx: MatrixClient,
requestData: RegisterRequest
requestData: RegisterRequest,
): Promise<RegisterResult> => {
const [err, res] = await to<RegisterResponse, MatrixError>(mx.registerRequest(requestData));
@@ -130,7 +130,7 @@ export const useRegisterComplete = (data?: CustomRegisterResponse) => {
withSearchParam<LoginPathSearchParams>(getLoginPath(userServer), {
username,
}),
{ replace: true }
{ replace: true },
);
}
}
@@ -120,7 +120,7 @@ export function PasswordResetForm({ defaultEmail }: PasswordResetFormProps) {
},
password: formData.password,
},
formData.password
formData.password,
);
}
}, [ongoingAuthData, flowErrorCode, formData, handleResetPassword]);
@@ -161,7 +161,7 @@ export function PasswordResetForm({ defaultEmail }: PasswordResetFormProps) {
const { password } = formData;
handleResetPassword(authDict, password);
},
[formData, handleResetPassword]
[formData, handleResetPassword],
);
return (
@@ -7,13 +7,13 @@ import { PasswordResetForm } from './PasswordResetForm';
import { ResetPasswordPathSearchParams } from '../../paths';
const useResetPasswordSearchParams = (
searchParams: URLSearchParams
searchParams: URLSearchParams,
): ResetPasswordPathSearchParams =>
useMemo(
() => ({
email: searchParams.get('email') ?? undefined,
}),
[searchParams]
[searchParams],
);
export function ResetPassword() {
@@ -6,10 +6,10 @@ export type ResetPasswordResult = [IAuthData, undefined] | [undefined, ResetPass
export const resetPassword = async (
mx: MatrixClient,
authDict: AuthDict,
newPassword: string
newPassword: string,
): Promise<ResetPasswordResult> => {
const [err, res] = await to<ResetPasswordResponse, MatrixError>(
mx.setPassword(authDict, newPassword, false)
mx.setPassword(authDict, newPassword, false),
);
if (err) {
+2 -2
View File
@@ -14,7 +14,7 @@ export function AutoDiscovery({ userId, baseUrl, children }: AutoDiscoveryProps)
useCallback(async () => {
const server = getMxIdServer(userId);
return autoDiscovery(fetch, server ?? userId);
}, [userId])
}, [userId]),
);
const [, info] = state.status === AsyncStatus.Success ? state.data : [];
@@ -25,7 +25,7 @@ export function AutoDiscovery({ userId, baseUrl, children }: AutoDiscoveryProps)
base_url: baseUrl,
},
}),
[baseUrl]
[baseUrl],
);
return <AutoDiscoveryInfoProvider value={info ?? fallback}>{children}</AutoDiscoveryInfoProvider>;
+4 -4
View File
@@ -100,7 +100,7 @@ function InviteNotifications() {
noti.close();
};
},
[navigate]
[navigate],
);
const playSound = useCallback(() => {
@@ -169,7 +169,7 @@ function MessageNotifications() {
notifRef.current?.close();
notifRef.current = noti;
},
[navigate]
[navigate],
);
const playSound = useCallback(() => {
@@ -183,7 +183,7 @@ function MessageNotifications() {
room,
toStartOfTimeline,
removed,
data
data,
) => {
if (mx.getSyncState() !== 'SYNCING') return;
if (document.hasFocus() && (selectedRoomId === room?.roomId || notificationSelected)) return;
@@ -218,7 +218,7 @@ function MessageNotifications() {
notify({
roomName: room.name ?? 'Unknown',
roomAvatar: avatarMxc
? mxcUrlToHttp(mx, avatarMxc, useAuthentication, 96, 96, 'crop') ?? undefined
? (mxcUrlToHttp(mx, avatarMxc, useAuthentication, 96, 96, 'crop') ?? undefined)
: undefined,
username: getMemberDisplayName(room, sender) ?? getMxIdLocalPart(sender) ?? sender,
roomId: room.roomId,
+3 -3
View File
@@ -154,11 +154,11 @@ export function ClientRoot({ children }: ClientRootProps) {
throw new Error('No session Found!');
}
return initClient(session);
}, [])
}, []),
);
const mx = loadState.status === AsyncStatus.Success ? loadState.data : undefined;
const [startState, startMatrix] = useAsyncCallback<void, Error, [MatrixClient]>(
useCallback((m) => startClient(m), [])
useCallback((m) => startClient(m), []),
);
useLogoutListener(mx);
@@ -181,7 +181,7 @@ export function ClientRoot({ children }: ClientRootProps) {
if (state === 'PREPARED') {
setLoading(false);
}
}, [])
}, []),
);
return (
+1 -1
View File
@@ -27,7 +27,7 @@ export function SyncStatus({ mx }: SyncStatusProps) {
}
return { current, previous };
});
}, [])
}, []),
);
if (
+5 -5
View File
@@ -195,10 +195,10 @@ export function Direct() {
if (a.size !== b.size) return false;
for (const id of a) if (!b.has(id)) return false;
return true;
}
},
),
[]
)
[],
),
);
const navigate = useNavigate();
@@ -224,7 +224,7 @@ export function Direct() {
});
const handleCategoryClick = useCategoryHandler(setClosedCategories, (categoryId) =>
closedCategories.has(categoryId)
closedCategories.has(categoryId),
);
return (
@@ -289,7 +289,7 @@ export function Direct() {
linkPath={getDirectRoomPath(getCanonicalAliasOrRoomId(mx, roomId))}
notificationMode={getRoomNotificationMode(
notificationPreferences,
room.roomId
room.roomId,
)}
/>
</VirtualTile>
+1 -1
View File
@@ -45,7 +45,7 @@ export function AddServer() {
const serverInputRef = useRef<HTMLInputElement>(null);
const [exploreState] = useAsyncCallback(
useCallback((server: string) => mx.publicRooms({ server, limit: 1 }), [mx])
useCallback((server: string) => mx.publicRooms({ server, limit: 1 }), [mx]),
);
const getInputServer = (): string | undefined => {
+3 -3
View File
@@ -55,7 +55,7 @@ const useServerSearchParams = (searchParams: URLSearchParams): ExploreServerPath
type: searchParams.get('type') ?? undefined,
instance: searchParams.get('instance') ?? undefined,
}),
[searchParams]
[searchParams],
);
type RoomTypeFilter = {
@@ -78,7 +78,7 @@ const useRoomTypeFilters = (): RoomTypeFilter[] =>
value: 'null',
},
],
[]
[],
);
const FALLBACK_ROOMS_LIMIT = 24;
@@ -393,7 +393,7 @@ export function PublicRooms() {
room_types: roomType !== undefined ? [roomType] : undefined,
},
third_party_instance_id: serverSearchParams.instance,
}
},
);
}, [mx, server, serverSearchParams]);
+7 -7
View File
@@ -222,10 +222,10 @@ export function Home() {
if (a.size !== b.size) return false;
for (const id of a) if (!b.has(id)) return false;
return true;
}
},
),
[]
)
[],
),
);
const navigate = useNavigate();
@@ -239,7 +239,7 @@ export function Home() {
const items = Array.from(rooms).sort(
closedCategories.has(DEFAULT_CATEGORY_ID)
? factoryRoomIdByActivity(mx)
: factoryRoomIdByAtoZ(mx)
: factoryRoomIdByAtoZ(mx),
);
if (closedCategories.has(DEFAULT_CATEGORY_ID)) {
return items.filter((rId) => roomsWithUnreadSet.has(rId) || rId === selectedRoomId);
@@ -255,7 +255,7 @@ export function Home() {
});
const handleCategoryClick = useCategoryHandler(setClosedCategories, (categoryId) =>
closedCategories.has(categoryId)
closedCategories.has(categoryId),
);
return (
@@ -313,7 +313,7 @@ export function Home() {
? withSearchParam<_RoomSearchParams>(path, {
viaServers: encodeSearchParamValueArray(viaServers),
})
: path
: path,
);
}}
/>
@@ -372,7 +372,7 @@ export function Home() {
linkPath={getHomeRoomPath(getCanonicalAliasOrRoomId(mx, roomId))}
notificationMode={getRoomNotificationMode(
notificationPreferences,
room.roomId
room.roomId,
)}
/>
</VirtualTile>
+10 -10
View File
@@ -107,7 +107,7 @@ const makeInviteData = (mx: MatrixClient, room: Room, useAuthentication: boolean
const senderId = memberEvent?.getSender();
const senderName = senderId
? getMemberDisplayName(room, senderId) ?? getMxIdLocalPart(senderId) ?? senderId
? (getMemberDisplayName(room, senderId) ?? getMxIdLocalPart(senderId) ?? senderId)
: undefined;
const inviteTs = memberEvent?.getTs();
const reason =
@@ -177,10 +177,10 @@ function InviteCard({
await addRoomIdToMDirect(mx, invite.roomId, dmUserId);
}
onNavigate(invite.roomId, invite.isSpace);
}, [mx, invite, userId, onNavigate])
}, [mx, invite, userId, onNavigate]),
);
const [leaveState, leave] = useAsyncCallback<Record<string, never>, MatrixError, []>(
useCallback(() => mx.leave(invite.roomId), [mx, invite])
useCallback(() => mx.leave(invite.roomId), [mx, invite]),
);
const joining =
@@ -482,7 +482,7 @@ function UnknownInvites({
const roomIds = invites.map((invite) => invite.roomId);
await rateLimitedActions(roomIds, (roomId) => mx.leave(roomId));
}, [mx, invites])
}, [mx, invites]),
);
const declining = declineAllStatus.status === AsyncStatus.Loading;
@@ -560,7 +560,7 @@ function SpamInvites({
const roomIds = invites.map((invite) => invite.roomId);
await rateLimitedActions(roomIds, (roomId) => mx.leave(roomId));
}, [mx, invites])
}, [mx, invites]),
);
const [reportAllStatus, reportAll] = useAsyncCallback(
@@ -568,18 +568,18 @@ function SpamInvites({
const roomIds = invites.map((invite) => invite.roomId);
await rateLimitedActions(roomIds, (roomId) => mx.reportRoom(roomId, 'Spam Invite'));
}, [mx, invites])
}, [mx, invites]),
);
const ignoredUsers = useIgnoredUsers();
const unignoredUsers = Array.from(new Set(invites.map((invite) => invite.senderId))).filter(
(user) => !ignoredUsers.includes(user)
(user) => !ignoredUsers.includes(user),
);
const [blockAllStatus, blockAll] = useAsyncCallback(
useCallback(
() => mx.setIgnoredUsers([...ignoredUsers, ...unignoredUsers]),
[mx, ignoredUsers, unignoredUsers]
)
[mx, ignoredUsers, unignoredUsers],
),
);
const declining = declineAllStatus.status === AsyncStatus.Loading;
@@ -736,7 +736,7 @@ export function Invites() {
const [compact, setCompact] = useState(document.body.clientWidth <= COMPACT_CARD_WIDTH);
useElementSizeObserver(
useCallback(() => containerRef.current, []),
useCallback((width) => setCompact(width <= COMPACT_CARD_WIDTH), [])
useCallback((width) => setCompact(width <= COMPACT_CARD_WIDTH), []),
);
const screenSize = useScreenSizeContext();
+21 -21
View File
@@ -111,7 +111,7 @@ type SilentReloadTimeline = () => Promise<void>;
const groupNotifications = (
notifications: INotification[],
allowRooms: Set<string>
allowRooms: Set<string>,
): RoomNotificationsGroup[] => {
const groups: RoomNotificationsGroup[] = [];
notifications.forEach((notification) => {
@@ -133,7 +133,7 @@ const groupNotifications = (
const useNotificationTimeline = (
paginationLimit: number,
onlyHighlight?: boolean
onlyHighlight?: boolean,
): [NotificationTimeline, LoadTimeline, SilentReloadTimeline] => {
const mx = useMatrixClient();
const allRooms = useAtomValue(allRoomsAtom);
@@ -149,10 +149,10 @@ const useNotificationTimeline = (
return mx.http.authedRequest<INotificationsResponse>(
Method.Get,
'/notifications',
queryParams
queryParams,
);
},
[mx]
[mx],
);
const loadTimeline: LoadTimeline = useCallback(
@@ -163,7 +163,7 @@ const useNotificationTimeline = (
const data = await fetchNotifications(
from,
paginationLimit,
onlyHighlight ? 'highlight' : undefined
onlyHighlight ? 'highlight' : undefined,
);
const groups = groupNotifications(data.notifications, allJoinedRooms);
@@ -177,7 +177,7 @@ const useNotificationTimeline = (
return currentTimeline;
});
},
[paginationLimit, onlyHighlight, fetchNotifications, allJoinedRooms]
[paginationLimit, onlyHighlight, fetchNotifications, allJoinedRooms],
);
/**
@@ -188,7 +188,7 @@ const useNotificationTimeline = (
const data = await fetchNotifications(
undefined,
paginationLimit,
onlyHighlight ? 'highlight' : undefined
onlyHighlight ? 'highlight' : undefined,
);
const groups = groupNotifications(data.notifications, allJoinedRooms);
setNotificationTimeline({
@@ -243,10 +243,10 @@ function RoomNotificationsGroupComp({
() => ({
...LINKIFY_OPTS,
render: factoryRenderLinkifyWithMention((href) =>
renderMatrixMention(mx, room.roomId, href, makeMentionCustomProps(mentionClickHandler))
renderMatrixMention(mx, room.roomId, href, makeMentionCustomProps(mentionClickHandler)),
),
}),
[mx, room, mentionClickHandler]
[mx, room, mentionClickHandler],
);
const htmlReactParserOptions = useMemo<HTMLReactParserOptions>(
() =>
@@ -256,7 +256,7 @@ function RoomNotificationsGroupComp({
handleSpoilerClick: spoilerClickHandler,
handleMentionClick: mentionClickHandler,
}),
[mx, room, linkifyOpts, mentionClickHandler, spoilerClickHandler, useAuthentication]
[mx, room, linkifyOpts, mentionClickHandler, spoilerClickHandler, useAuthentication],
);
const renderMatrixEvent = useMatrixEventRenderer<[IRoomEvent, string, GetContentCallback]>(
@@ -318,7 +318,7 @@ function RoomNotificationsGroupComp({
const editedEvent = getEditedEvent(
evt.event_id,
mEvent,
evtTimeline.getTimelineSet()
evtTimeline.getTimelineSet(),
);
const getContent = (() =>
editedEvent?.getContent()['m.new_content'] ??
@@ -395,7 +395,7 @@ function RoomNotificationsGroupComp({
</Text>
</Box>
);
}
},
);
const handleOpenClick: MouseEventHandler = (evt) => {
@@ -484,14 +484,14 @@ function RoomNotificationsGroupComp({
userId={event.sender}
src={
senderAvatarMxc
? mxcUrlToHttp(
? (mxcUrlToHttp(
mx,
senderAvatarMxc,
useAuthentication,
48,
48,
'crop'
) ?? undefined
'crop',
) ?? undefined)
: undefined
}
alt={displayName}
@@ -550,13 +550,13 @@ function RoomNotificationsGroupComp({
}
const useNotificationsSearchParams = (
searchParams: URLSearchParams
searchParams: URLSearchParams,
): InboxNotificationsPathSearchParams =>
useMemo(
() => ({
only: searchParams.get('only') ?? undefined,
}),
[searchParams]
[searchParams],
);
const DEFAULT_REFRESH_MS = 7000;
@@ -585,7 +585,7 @@ export function Notifications() {
setSearchParams(
new URLSearchParams({
only: 'highlight',
})
}),
);
return;
}
@@ -594,7 +594,7 @@ export function Notifications() {
const [notificationTimeline, _loadTimeline, silentReloadTimeline] = useNotificationTimeline(
24,
onlyHighlight
onlyHighlight,
);
const [timelineState, loadTimeline] = useAsyncCallback(_loadTimeline);
@@ -610,12 +610,12 @@ export function Notifications() {
useCallback(() => {
silentReloadTimeline();
}, [silentReloadTimeline]),
refreshIntervalTime
refreshIntervalTime,
);
const handleScrollTopVisibility = useCallback(
(onTop: boolean) => setRefreshIntervalTime(onTop ? DEFAULT_REFRESH_MS : -1),
[]
[],
);
useEffect(() => {
+1 -1
View File
@@ -121,7 +121,7 @@ export function CreateTab() {
? withSearchParam<_RoomSearchParams>(path, {
viaServers: encodeSearchParamValueArray(viaServers),
})
: path
: path,
);
}}
/>
+1 -1
View File
@@ -20,7 +20,7 @@ export function SettingsTab() {
const displayName = profile.displayName ?? getMxIdLocalPart(userId) ?? userId;
const avatarUrl = profile.avatarUrl
? mxcUrlToHttp(mx, profile.avatarUrl, useAuthentication, 96, 96, 'crop') ?? undefined
? (mxcUrlToHttp(mx, profile.avatarUrl, useAuthentication, 96, 96, 'crop') ?? undefined)
: undefined;
const openSettings = () => setSettings(true);
+13 -13
View File
@@ -116,7 +116,7 @@ const SpaceMenu = forwardRef<HTMLDivElement, SpaceMenuProps>(
const allChild = useSpaceChildren(
allRoomsAtom,
room.roomId,
useRecursiveChildScopeFactory(mx, roomToParents)
useRecursiveChildScopeFactory(mx, roomToParents),
);
const unread = useRoomsUnread(allChild, roomToUnreadAtom);
@@ -221,7 +221,7 @@ const SpaceMenu = forwardRef<HTMLDivElement, SpaceMenuProps>(
</Box>
</Menu>
);
}
},
);
type InstructionType = Instruction['type'];
@@ -236,7 +236,7 @@ const useDraggableItem = (
item: SidebarDraggable,
targetRef: RefObject<HTMLElement>,
onDragging: (item?: SidebarDraggable) => void,
dragHandleRef?: RefObject<HTMLElement>
dragHandleRef?: RefObject<HTMLElement>,
): boolean => {
const [dragging, setDragging] = useState(false);
@@ -266,7 +266,7 @@ const useDraggableItem = (
const useDropTarget = (
item: SidebarDraggable,
targetRef: RefObject<HTMLElement>
targetRef: RefObject<HTMLElement>,
): Instruction | undefined => {
const [dropState, setDropState] = useState<Instruction>();
@@ -293,7 +293,7 @@ const useDropTarget = (
indentPerLevel: 0,
mode: 'standard',
block,
}
},
);
const instruction: Instruction | null = extractInstruction(insData);
@@ -315,7 +315,7 @@ const useDropTarget = (
function useDropTargetInstruction<T extends InstructionType>(
item: SidebarDraggable,
targetRef: RefObject<HTMLElement>,
instructionType: T
instructionType: T,
): T | undefined {
const [dropState, setDropState] = useState<T>();
@@ -351,8 +351,8 @@ const useDnDMonitor = (
onReorder: (
draggable: SidebarDraggable,
container: SidebarDraggable,
instruction: InstructionType
) => void
instruction: InstructionType,
) => void,
) => {
useEffect(() => {
const scrollElement = scrollRef.current;
@@ -377,7 +377,7 @@ const useDnDMonitor = (
}),
autoScrollForElements({
element: scrollElement,
})
}),
);
}, [scrollRef, onDragging, onReorder]);
};
@@ -412,7 +412,7 @@ function SpaceTab({
spaceId: space.roomId,
}
: space.roomId,
[folder, space]
[folder, space],
);
useDraggableItem(spaceDraggable, targetRef, onDragging);
@@ -754,8 +754,8 @@ export function SpaceTabs({ scrollRef }: SpaceTabsProps) {
localEchoSidebarItem(parseSidebar(mx, orphanSpaces, newSpacesContent));
mx.setAccountData(AccountDataEvent.CinnySpaces, newSpacesContent);
},
[mx, sidebarItems, setOpenedFolder, localEchoSidebarItem, orphanSpaces]
)
[mx, sidebarItems, setOpenedFolder, localEchoSidebarItem, orphanSpaces],
),
);
const selectedSpaceId = useSelectedSpace();
@@ -800,7 +800,7 @@ export function SpaceTabs({ scrollRef }: SpaceTabsProps) {
localEchoSidebarItem(parseSidebar(mx, orphanSpaces, newSpacesContent));
mx.setAccountData(AccountDataEvent.CinnySpaces, newSpacesContent);
},
[mx, sidebarItems, orphanSpaces, localEchoSidebarItem]
[mx, sidebarItems, orphanSpaces, localEchoSidebarItem],
);
if (sidebarItems.length === 0) return null;
@@ -29,7 +29,7 @@ function UnverifiedIndicator() {
const verificationStatus = useDeviceVerificationStatus(
crypto,
mx.getSafeUserId(),
currentDevice?.device_id
currentDevice?.device_id,
);
const unverified = verificationStatus === VerificationStatus.Unverified;
@@ -37,7 +37,7 @@ function UnverifiedIndicator() {
const unverifiedDeviceCount = useUnverifiedDeviceCount(
crypto,
mx.getSafeUserId(),
otherDevicesId
otherDevicesId,
);
const [settings, setSettings] = useState(false);
+1 -1
View File
@@ -23,7 +23,7 @@ export function SpaceSearch() {
const rooms = useSpaceChildren(
allRoomsAtom,
space.roomId,
useRecursiveChildRoomScopeFactory(mx, mDirects, roomToParents)
useRecursiveChildRoomScopeFactory(mx, mDirects, roomToParents),
);
return (
+11 -11
View File
@@ -109,7 +109,7 @@ const SpaceMenu = forwardRef<HTMLDivElement, SpaceMenuProps>(({ room, requestClo
const allChild = useSpaceChildren(
allRoomsAtom,
room.roomId,
useRecursiveChildScopeFactory(mx, roomToParents)
useRecursiveChildScopeFactory(mx, roomToParents),
);
const unread = useRoomsUnread(allChild, roomToUnreadAtom);
@@ -252,7 +252,7 @@ function SpaceHeader() {
const joinRules = useStateEvent(
space,
StateEvent.RoomJoinRules
StateEvent.RoomJoinRules,
)?.getContent<RoomJoinRulesEventContent>();
const handleOpenMenu: MouseEventHandler<HTMLButtonElement> = (evt) => {
@@ -325,7 +325,7 @@ export function SpaceTombstone({ roomId, replacementRoomId }: SpaceTombstoneProp
return mx.joinRoom(replacementRoomId, {
viaServers: via,
});
}, [mx, roomId, replacementRoomId])
}, [mx, roomId, replacementRoomId]),
);
const replacementRoom = mx.getRoom(replacementRoomId);
@@ -403,10 +403,10 @@ export function Space() {
if (a.size !== b.size) return false;
for (const id of a) if (!b.has(id)) return false;
return true;
}
},
),
[]
)
[],
),
);
const allRooms = useAtomValue(allRoomsAtom);
const allJoinedRooms = useMemo(() => new Set(allRooms), [allRooms]);
@@ -427,7 +427,7 @@ export function Space() {
}
return undefined;
},
[mx, allJoinedRooms]
[mx, allJoinedRooms],
);
const hierarchy = useSpaceJoinedHierarchy(
@@ -444,12 +444,12 @@ export function Space() {
callEmbed?.roomId === roomId;
return !showRoomAnyway;
},
[space.roomId, closedCategories, roomsWithUnreadSet, selectedRoomId, callEmbed]
[space.roomId, closedCategories, roomsWithUnreadSet, selectedRoomId, callEmbed],
),
useCallback(
(sId) => closedCategories.has(makeNavCategoryId(space.roomId, sId)),
[closedCategories, space.roomId]
)
[closedCategories, space.roomId],
),
);
const virtualizer = useVirtualizer({
@@ -460,7 +460,7 @@ export function Space() {
});
const handleCategoryClick = useCategoryHandler(setClosedCategories, (categoryId) =>
closedCategories.has(categoryId)
closedCategories.has(categoryId),
);
const getToLink = (roomId: string) =>
+1 -1
View File
@@ -7,7 +7,7 @@ export const getRoomSearchParams: SearchParamsGetter<_RoomSearchParams> = (searc
});
export const getDirectCreateSearchParams: SearchParamsGetter<DirectCreateSearchParams> = (
searchParams
searchParams,
) => ({
userId: searchParams.get('userId') ?? undefined,
});
+2 -2
View File
@@ -31,7 +31,7 @@ export const joinPathComponent = (path: Path): string => path.pathname + path.se
export const withSearchParam = <T extends Record<string, string>>(
path: string,
searchParam: T
searchParam: T,
): string => {
const params = new URLSearchParams(searchParam);
@@ -133,7 +133,7 @@ export const getSpaceSearchPath = (spaceIdOrAlias: string): string => {
export const getSpaceRoomPath = (
spaceIdOrAlias: string,
roomIdOrAlias: string,
eventId?: string
eventId?: string,
): string => {
const params = {
spaceIdOrAlias: encodeURIComponent(spaceIdOrAlias),