Rewrite the restricted iterators and reorder the forward references. [skip build]
Checks / checks (push) Successful in 2m11s
Trigger cinny-mobile / dispatch (push) Successful in 2s

This commit is contained in:
2026-11-01 21:05:47 +11:00
parent 5477242661
commit 664b7eb739
25 changed files with 472 additions and 437 deletions
+2 -1
View File
@@ -276,7 +276,8 @@ export function useRoomCall(roomId: string) {
);
// Check each homeserver in priority order
for (const homeserver of homeserverPriority) {
for (let i = 0; i < homeserverPriority.length; i += 1) {
const homeserver = homeserverPriority[i];
try {
console.log(`Fetching well-known from ${homeserver}...`);
const wellKnown = await fetchWellKnownWithRTC(homeserver);
+2 -1
View File
@@ -283,7 +283,8 @@ export async function fetchLiveKitJWTFromServers(
deviceId: string,
accessToken: string,
): Promise<{ jwt: LiveKitJWTResponse; homeserver: string } | null> {
for (const homeserver of homeservers) {
for (let i = 0; i < homeservers.length; i += 1) {
const homeserver = homeservers[i];
try {
console.log(`Trying LiveKit JWT from homeserver: ${homeserver}`);
+4 -2
View File
@@ -149,13 +149,15 @@ export function ForumNewPostModal({
eventId = await sendForumMediaRoot(mx, topicRoomId, trimmedTitle, first);
publishedPlainText = typeof first.body === 'string' ? first.body : trimmedTitle;
publishedHtml = '';
for (const content of rest) {
for (let i = 0; i < rest.length; i += 1) {
const content = rest[i];
await sendForumThreadAttachment(mx, topicRoomId, eventId, content);
}
}
if (hasText) {
for (const content of attachmentContents) {
for (let i = 0; i < attachmentContents.length; i += 1) {
const content = attachmentContents[i];
await sendForumThreadAttachment(mx, topicRoomId, eventId, content);
}
}
+70 -69
View File
@@ -357,6 +357,74 @@ export async function listForumTopics(
return topics.sort((a, b) => a.name.localeCompare(b.name));
}
function isSecondaryMatrixEvent(mEvent: MatrixEvent): boolean {
const relation = mEvent.getRelation();
if (
relation?.rel_type === RelationType.Replace ||
relation?.rel_type === RelationType.Annotation
) {
return true;
}
return isAnnotationRoomMessage(mEvent.getContent());
}
function matrixEventToRoomEvent(mEvent: MatrixEvent): IRoomEvent {
return mEvent.event as IRoomEvent;
}
function collectLocalReplaceEdits(room: Room, targetIds: Set<string>): IRoomEvent[] {
const events: IRoomEvent[] = [];
const seen = new Set<string>();
room
.getUnfilteredTimelineSet()
.getLiveTimeline()
.getEvents()
.forEach((mEvent) => {
if (mEvent.isRedacted() || mEvent.getType() !== EventType.RoomMessage) return;
const relation = mEvent.getRelation();
if (relation?.rel_type !== RelationType.Replace) return;
const targetId = relation.event_id;
if (!targetId || !targetIds.has(targetId)) return;
const id = mEvent.getId();
if (!id || seen.has(id)) return;
seen.add(id);
events.push(matrixEventToRoomEvent(mEvent));
});
return events;
}
function collectLocalRootPosts(mx: MatrixClient, roomId: string): IRoomEvent[] {
const room = mx.getRoom(roomId);
if (!room) return [];
const seen = new Set<string>();
const events: IRoomEvent[] = [];
room
.getUnfilteredTimelineSet()
.getLiveTimeline()
.getEvents()
.forEach((mEvent) => {
if (mEvent.isRedacted() || mEvent.getType() !== EventType.RoomMessage) return;
if (isSecondaryMatrixEvent(mEvent)) return;
const relation = threadRelationFromContent(mEvent.getContent());
const isThreadReply =
relation?.rel_type === RelationType.Thread || relation?.rel_type === 'm.thread';
if (isThreadReply) return;
const id = mEvent.getId();
if (!id || seen.has(id)) return;
seen.add(id);
events.push(matrixEventToRoomEvent(mEvent));
});
const rootIds = new Set(events.map((event) => event.event_id).filter(Boolean) as string[]);
events.push(...collectLocalReplaceEdits(room, rootIds));
return events;
}
export async function listTopicFeedPosts(
mx: MatrixClient,
roomId: string,
@@ -402,17 +470,6 @@ function mergeUniqueRoomEvents(...lists: IRoomEvent[][]): IRoomEvent[] {
return unique;
}
function isSecondaryMatrixEvent(mEvent: MatrixEvent): boolean {
const relation = mEvent.getRelation();
if (
relation?.rel_type === RelationType.Replace ||
relation?.rel_type === RelationType.Annotation
) {
return true;
}
return isAnnotationRoomMessage(mEvent.getContent());
}
function eventBelongsToThread(mEvent: MatrixEvent, rootEventId: string): boolean {
if (mEvent.getId() === rootEventId) return true;
@@ -432,33 +489,6 @@ function eventBelongsToThread(mEvent: MatrixEvent, rootEventId: string): boolean
return false;
}
function matrixEventToRoomEvent(mEvent: MatrixEvent): IRoomEvent {
return mEvent.event as IRoomEvent;
}
function collectLocalReplaceEdits(room: Room, targetIds: Set<string>): IRoomEvent[] {
const events: IRoomEvent[] = [];
const seen = new Set<string>();
room
.getUnfilteredTimelineSet()
.getLiveTimeline()
.getEvents()
.forEach((mEvent) => {
if (mEvent.isRedacted() || mEvent.getType() !== EventType.RoomMessage) return;
const relation = mEvent.getRelation();
if (relation?.rel_type !== RelationType.Replace) return;
const targetId = relation.event_id;
if (!targetId || !targetIds.has(targetId)) return;
const id = mEvent.getId();
if (!id || seen.has(id)) return;
seen.add(id);
events.push(matrixEventToRoomEvent(mEvent));
});
return events;
}
/** Thread events already in the local room timeline (includes unsent/local echo). */
export function collectLocalThreadEvents(
mx: MatrixClient,
@@ -506,36 +536,6 @@ export function collectLocalThreadEvents(
return events;
}
function collectLocalRootPosts(mx: MatrixClient, roomId: string): IRoomEvent[] {
const room = mx.getRoom(roomId);
if (!room) return [];
const seen = new Set<string>();
const events: IRoomEvent[] = [];
room
.getUnfilteredTimelineSet()
.getLiveTimeline()
.getEvents()
.forEach((mEvent) => {
if (mEvent.isRedacted() || mEvent.getType() !== EventType.RoomMessage) return;
if (isSecondaryMatrixEvent(mEvent)) return;
const relation = threadRelationFromContent(mEvent.getContent());
const isThreadReply =
relation?.rel_type === RelationType.Thread || relation?.rel_type === 'm.thread';
if (isThreadReply) return;
const id = mEvent.getId();
if (!id || seen.has(id)) return;
seen.add(id);
events.push(matrixEventToRoomEvent(mEvent));
});
const rootIds = new Set(events.map((event) => event.event_id).filter(Boolean) as string[]);
events.push(...collectLocalReplaceEdits(room, rootIds));
return events;
}
export function loadPostThreadLocal(
mx: MatrixClient,
roomId: string,
@@ -628,7 +628,8 @@ export async function loadAggregatedTopicFeed(
scopes: Array<{ roomId: string; sectionTitle?: string; topicName?: string }>,
): Promise<ForumPost[]> {
const allPosts: ForumPost[] = [];
for (const scope of scopes) {
for (let i = 0; i < scopes.length; i += 1) {
const scope = scopes[i];
const { posts } = await listTopicFeedPosts(mx, scope.roomId, { minRoots: 5 });
annotatePostsWithRoomScope(posts, scope.roomId, scope);
allPosts.push(...posts);
+2 -1
View File
@@ -114,7 +114,8 @@ export function annotatePostsWithRoomScope(
const sectionTitle = scope?.sectionTitle ? String(scope.sectionTitle) : '';
const topicName = scope?.topicName ? String(scope.topicName) : '';
for (const post of posts) {
for (let i = 0; i < posts.length; i += 1) {
const post = posts[i];
post.topicRoomId = roomId;
if (sectionTitle) post.sectionTitle = sectionTitle;
if (topicName) post.topicName = topicName;
+3 -1
View File
@@ -265,7 +265,9 @@ export function parseTopicSearchQuery(raw: string): ParsedTopicSearch {
}
let remainder = input;
for (const match of input.matchAll(QUALIFIER_RE)) {
const matches = Array.from(input.matchAll(QUALIFIER_RE));
for (let i = 0; i < matches.length; i += 1) {
const match = matches[i];
const key = String(match[1] || '').toLowerCase();
const value = String(match[3] || match[4] || '').trim();
if (value) {
+2 -1
View File
@@ -38,7 +38,8 @@ function scopesFromSelection(
topic?: string,
): Array<{ roomId: string; sectionTitle?: string; topicName?: string }> {
if (topic) {
for (const section of sections) {
for (let i = 0; i < sections.length; i += 1) {
const section = sections[i];
const match = section.topics.find((t) => t.roomId === topic);
if (match) {
return [{ roomId: match.roomId, sectionTitle: section.title, topicName: match.name }];
@@ -24,8 +24,9 @@ export function findEmojiOriginInMessage(
const message = document.querySelector(`[data-message-id="${CSS.escape(targetEventId)}"]`);
if (!message) return undefined;
const matches = message.querySelectorAll('[data-emoticon]');
for (const element of matches) {
const matches = Array.from(message.querySelectorAll('[data-emoticon]'));
for (let i = 0; i < matches.length; i += 1) {
const element = matches[i];
if (element.getAttribute('data-emoticon') === emoji) {
return getBurstPointFromElement(element);
}
@@ -12,12 +12,16 @@ export function extractJumboEmojis(body: string): string[] {
const found: string[] = [];
for (const match of trimmedBody.matchAll(EMOJI_REG_G)) {
const emojiMatches = Array.from(trimmedBody.matchAll(EMOJI_REG_G));
for (let i = 0; i < emojiMatches.length; i += 1) {
const match = emojiMatches[i];
const emoji = match[1];
if (emoji) found.push(emoji);
}
for (const match of trimmedBody.matchAll(SHORTCODE_PATTERN)) {
const shortcodeMatches = Array.from(trimmedBody.matchAll(SHORTCODE_PATTERN));
for (let i = 0; i < shortcodeMatches.length; i += 1) {
const match = shortcodeMatches[i];
const shortcode = match[1];
const resolved = emojis.find((emoji) => emoji.shortcode === shortcode);
if (resolved) found.push(resolved.unicode);
@@ -196,6 +196,14 @@ function ProfileBanner({
}
}, [presence?.status, isEditingStatus]);
// Avatar-specific upload
const [avatarFile, setAvatarFile] = useState<File>();
const avatarUploadAtom = useMemo(() => {
if (avatarFile) return createUploadAtom(avatarFile);
return undefined;
}, [avatarFile]);
const pickAvatarFile = useFilePicker(setAvatarFile, false);
const handleAvatarClick = () => {
pickAvatarFile('image/*');
};
@@ -336,14 +344,6 @@ function ProfileBanner({
const pickFile = useFilePicker(setImageFile, false);
// Avatar-specific upload
const [avatarFile, setAvatarFile] = useState<File>();
const avatarUploadAtom = useMemo(() => {
if (avatarFile) return createUploadAtom(avatarFile);
return undefined;
}, [avatarFile]);
const pickAvatarFile = useFilePicker(setAvatarFile, false);
// Warn before leaving when an upload or save is in progress
useEffect(() => {
if (!imageFile && !avatarFile && !saving) return undefined;
@@ -91,81 +91,6 @@ function EmailNotification() {
);
}
export function SystemNotification() {
const notifPermission = usePermissionState('notifications', getNotificationState());
const capacitorNative = isCapacitorNative();
const [showNotifications, setShowNotifications] = useSetting(settingsAtom, 'showNotifications');
const [isNotificationSounds, setIsNotificationSounds] = useSetting(
settingsAtom,
'isNotificationSounds',
);
const requestNotificationPermission = async () => {
await requestSystemNotificationPermission();
};
return (
<Box direction="Column" gap="100">
<Text size="L400">System</Text>
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<SettingTile
title="Desktop Notifications"
description={
notifPermission === 'denied' ? (
<Text as="span" style={{ color: color.Critical.Main }} size="T200">
{'Notification' in window
? 'Notification permission is blocked. Please allow notification permission from browser address bar.'
: 'Notifications are not supported by the system.'}
</Text>
) : (
<span>Show desktop notifications when message arrive.</span>
)
}
after={
notifPermission === 'prompt' ? (
<Button size="300" radii="300" onClick={requestNotificationPermission}>
<Text size="B300">Enable</Text>
</Button>
) : (
<Switch
disabled={!capacitorNative && notifPermission !== 'granted'}
value={showNotifications}
onChange={setShowNotifications}
/>
)
}
/>
</SequenceCard>
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<SettingTile
title="Notification Sound"
description="Play sound when new message arrive."
after={<Switch value={isNotificationSounds} onChange={setIsNotificationSounds} />}
/>
</SequenceCard>
{isBackgroundSyncSupported() && <AndroidPushNotifications />}
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<EmailNotification />
</SequenceCard>
</Box>
);
}
type PushStatus = {
registered: boolean;
distributor: string;
@@ -352,3 +277,78 @@ function AndroidPushNotifications() {
</Box>
);
}
export function SystemNotification() {
const notifPermission = usePermissionState('notifications', getNotificationState());
const capacitorNative = isCapacitorNative();
const [showNotifications, setShowNotifications] = useSetting(settingsAtom, 'showNotifications');
const [isNotificationSounds, setIsNotificationSounds] = useSetting(
settingsAtom,
'isNotificationSounds',
);
const requestNotificationPermission = async () => {
await requestSystemNotificationPermission();
};
return (
<Box direction="Column" gap="100">
<Text size="L400">System</Text>
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<SettingTile
title="Desktop Notifications"
description={
notifPermission === 'denied' ? (
<Text as="span" style={{ color: color.Critical.Main }} size="T200">
{'Notification' in window
? 'Notification permission is blocked. Please allow notification permission from browser address bar.'
: 'Notifications are not supported by the system.'}
</Text>
) : (
<span>Show desktop notifications when message arrive.</span>
)
}
after={
notifPermission === 'prompt' ? (
<Button size="300" radii="300" onClick={requestNotificationPermission}>
<Text size="B300">Enable</Text>
</Button>
) : (
<Switch
disabled={!capacitorNative && notifPermission !== 'granted'}
value={showNotifications}
onChange={setShowNotifications}
/>
)
}
/>
</SequenceCard>
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<SettingTile
title="Notification Sound"
description="Play sound when new message arrive."
after={<Switch value={isNotificationSounds} onChange={setIsNotificationSounds} />}
/>
</SequenceCard>
{isBackgroundSyncSupported() && <AndroidPushNotifications />}
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<EmailNotification />
</SequenceCard>
</Box>
);
}
+102 -101
View File
@@ -11,107 +11,6 @@ interface PluginLoaderProps {
children: React.ReactNode;
}
/**
* Component that loads and initializes enabled plugins.
* Should be placed high in the component tree after MatrixClient is available.
*/
export function PluginLoader({ matrixClient, children }: PluginLoaderProps) {
console.log('[PluginLoader] Component rendering, matrixClient:', !!matrixClient);
useEffect(() => {
const loadPlugins = async () => {
try {
console.log('[PluginLoader] Loading plugins...');
console.log('[PluginLoader] window.electron:', !!window.electron);
console.log('[PluginLoader] window.electron.plugins:', !!window.electron?.plugins);
if (!window.electron?.plugins) {
console.log('[PluginLoader] Running in web mode, plugins not supported');
return;
}
const pluginsToLoad = await pluginMarketplaceManager.listEnabledPlugins();
console.log('[PluginLoader] Plugins to load:', pluginsToLoad.length);
console.log(
'[PluginLoader] Plugin list:',
pluginsToLoad.map((p) => p.id),
);
for (const installedPlugin of pluginsToLoad) {
try {
console.log(`[PluginLoader] Loading plugin: ${installedPlugin.id}`);
const pluginModule = await loadPluginModule(installedPlugin.id);
const plugin = normalisePlugin(pluginModule);
if (!plugin || typeof plugin !== 'object') {
console.error(
`[PluginLoader] Plugin ${installedPlugin.id} does not export a valid plugin object`,
);
} else if (typeof plugin.onLoad !== 'function') {
console.error(
`[PluginLoader] Plugin ${installedPlugin.id} does not have an onLoad function`,
);
} else {
const context = createPluginContext(
{
pluginId: installedPlugin.id,
eventClient: matrixClient as any,
onNotify: async (opts) => {
await sendNotification({
title: opts.title,
body: opts.body,
path: undefined,
});
},
},
pluginRegistry,
);
const compatContext = Object.assign(context as Record<string, unknown>, {
matrixClient,
matrix: {
on: (eventType: string, handler: (...args: unknown[]) => void) =>
matrixClient.on(eventType as any, handler as any),
off: (eventType: string, handler: (...args: unknown[]) => void) =>
matrixClient.off(eventType as any, handler as any),
},
React,
lucide,
});
console.log('[PluginLoader] compatContext.React:', !!compatContext.React);
console.log('[PluginLoader] compatContext.ui:', !!compatContext.ui);
console.log('[PluginLoader] About to register plugin and call onLoad...');
pluginRegistry.registerPlugin(installedPlugin.id, plugin, context);
await plugin.onLoad(compatContext as any);
console.log(`[PluginLoader] Successfully loaded plugin: ${installedPlugin.id}`);
dispatchPluginButtonsChanged();
}
} catch (error) {
console.error(`[PluginLoader] Failed to load plugin ${installedPlugin.id}:`, error);
pluginRegistry.addLog(installedPlugin.id, 'error', ['Failed to load:', error]);
}
}
} catch (error) {
console.error('[PluginLoader] Error loading plugins:', error);
}
};
loadPlugins();
return () => {
console.log('[PluginLoader] Cleaning up plugins');
pluginRegistry.clear();
dispatchPluginButtonsChanged();
};
}, [matrixClient]);
return children;
}
/**
* Reads and evaluates a plugin's JS module from the Electron filesystem.
* Supports both CommonJS and ESM-style exports.
@@ -187,3 +86,105 @@ function normalisePlugin(raw: Record<string, unknown>): Plugin {
return raw as unknown as Plugin;
}
/**
* Component that loads and initializes enabled plugins.
* Should be placed high in the component tree after MatrixClient is available.
*/
export function PluginLoader({ matrixClient, children }: PluginLoaderProps) {
console.log('[PluginLoader] Component rendering, matrixClient:', !!matrixClient);
useEffect(() => {
const loadPlugins = async () => {
try {
console.log('[PluginLoader] Loading plugins...');
console.log('[PluginLoader] window.electron:', !!window.electron);
console.log('[PluginLoader] window.electron.plugins:', !!window.electron?.plugins);
if (!window.electron?.plugins) {
console.log('[PluginLoader] Running in web mode, plugins not supported');
return;
}
const pluginsToLoad = await pluginMarketplaceManager.listEnabledPlugins();
console.log('[PluginLoader] Plugins to load:', pluginsToLoad.length);
console.log(
'[PluginLoader] Plugin list:',
pluginsToLoad.map((p) => p.id),
);
for (let i = 0; i < pluginsToLoad.length; i += 1) {
const installedPlugin = pluginsToLoad[i];
try {
console.log(`[PluginLoader] Loading plugin: ${installedPlugin.id}`);
const pluginModule = await loadPluginModule(installedPlugin.id);
const plugin = normalisePlugin(pluginModule);
if (!plugin || typeof plugin !== 'object') {
console.error(
`[PluginLoader] Plugin ${installedPlugin.id} does not export a valid plugin object`,
);
} else if (typeof plugin.onLoad !== 'function') {
console.error(
`[PluginLoader] Plugin ${installedPlugin.id} does not have an onLoad function`,
);
} else {
const context = createPluginContext(
{
pluginId: installedPlugin.id,
eventClient: matrixClient as any,
onNotify: async (opts) => {
await sendNotification({
title: opts.title,
body: opts.body,
path: undefined,
});
},
},
pluginRegistry,
);
const compatContext = Object.assign(context as Record<string, unknown>, {
matrixClient,
matrix: {
on: (eventType: string, handler: (...args: unknown[]) => void) =>
matrixClient.on(eventType as any, handler as any),
off: (eventType: string, handler: (...args: unknown[]) => void) =>
matrixClient.off(eventType as any, handler as any),
},
React,
lucide,
});
console.log('[PluginLoader] compatContext.React:', !!compatContext.React);
console.log('[PluginLoader] compatContext.ui:', !!compatContext.ui);
console.log('[PluginLoader] About to register plugin and call onLoad...');
pluginRegistry.registerPlugin(installedPlugin.id, plugin, context);
await plugin.onLoad(compatContext as any);
console.log(`[PluginLoader] Successfully loaded plugin: ${installedPlugin.id}`);
dispatchPluginButtonsChanged();
}
} catch (error) {
console.error(`[PluginLoader] Failed to load plugin ${installedPlugin.id}:`, error);
pluginRegistry.addLog(installedPlugin.id, 'error', ['Failed to load:', error]);
}
}
} catch (error) {
console.error('[PluginLoader] Error loading plugins:', error);
}
};
loadPlugins();
return () => {
console.log('[PluginLoader] Cleaning up plugins');
pluginRegistry.clear();
dispatchPluginButtonsChanged();
};
}, [matrixClient]);
return children;
}
+37 -37
View File
@@ -31,43 +31,6 @@ import { pluginMarketplaceManager, pluginRegistry, SettingDefinition } from './P
import { stopPropagation } from '../../../utils/keyboard';
import { fuzzyFilter } from '../../../utils/fuzzy';
/**
* Renders settings UI for a plugin based on its settings schema
*/
function PluginSettingsRenderer({ pluginId }: { pluginId: string }) {
const schema = pluginRegistry.getPluginSettingsSchema(pluginId);
const [, forceUpdate] = useState({});
if (!schema || Object.keys(schema).length === 0) {
return (
<Box padding="300">
<Text size="T300" priority="300">
No settings available for this plugin.
</Text>
</Box>
);
}
const handleChange = (key: string, value: any) => {
pluginRegistry.setPluginSetting(pluginId, key, value);
forceUpdate({});
};
return (
<Box direction="Column" gap="300" style={{ padding: config.space.S400 }}>
{Object.entries(schema).map(([key, def]) => (
<SettingRenderer
key={key}
settingKey={key}
definition={def}
value={pluginRegistry.getPluginSetting(pluginId, key)}
onChange={(value) => handleChange(key, value)}
/>
))}
</Box>
);
}
/**
* Renders a single setting based on its type
*/
@@ -242,6 +205,43 @@ function SettingRenderer({
return null;
}
/**
* Renders settings UI for a plugin based on its settings schema
*/
function PluginSettingsRenderer({ pluginId }: { pluginId: string }) {
const schema = pluginRegistry.getPluginSettingsSchema(pluginId);
const [, forceUpdate] = useState({});
if (!schema || Object.keys(schema).length === 0) {
return (
<Box padding="300">
<Text size="T300" priority="300">
No settings available for this plugin.
</Text>
</Box>
);
}
const handleChange = (key: string, value: any) => {
pluginRegistry.setPluginSetting(pluginId, key, value);
forceUpdate({});
};
return (
<Box direction="Column" gap="300" style={{ padding: config.space.S400 }}>
{Object.entries(schema).map(([key, def]) => (
<SettingRenderer
key={key}
settingKey={key}
definition={def}
value={pluginRegistry.getPluginSetting(pluginId, key)}
onChange={(value) => handleChange(key, value)}
/>
))}
</Box>
);
}
function PluginAvatar({ thumbnail, name }: { thumbnail: string; name: string }) {
const [imageError, setImageError] = useState(false);
@@ -112,7 +112,8 @@ export function Permissions({ requestClose }: PermissionsProps) {
const total = syncableChildren.length;
const myUserId = mx.getSafeUserId();
for (const childId of syncableChildren) {
for (let i = 0; i < syncableChildren.length; i += 1) {
const childId = syncableChildren[i];
try {
const childRoom = mx.getRoom(childId);
if (childRoom) {
@@ -220,7 +221,8 @@ export function Permissions({ requestClose }: PermissionsProps) {
const total = syncableChildren.length;
const myUserId = mx.getSafeUserId();
for (const childId of syncableChildren) {
for (let i = 0; i < syncableChildren.length; i += 1) {
const childId = syncableChildren[i];
try {
const childRoom = mx.getRoom(childId);
if (childRoom) {