Rewrite the restricted iterators and reorder the forward references. [skip build]
This commit is contained in:
@@ -147,7 +147,9 @@ export const useRoomMediaEvents = (room: Room) => {
|
||||
setHasMore(false);
|
||||
}
|
||||
|
||||
for (const raw of response.chunk ?? []) {
|
||||
const chunk = response.chunk ?? [];
|
||||
for (let i = 0; i < chunk.length; i += 1) {
|
||||
const raw = chunk[i];
|
||||
const mEvent = await decryptEvent(raw);
|
||||
const item = toMediaItem(mEvent);
|
||||
if (item && !cache.seenIds.has(item.eventId)) {
|
||||
|
||||
@@ -41,7 +41,9 @@ const MAX_AUTO_PAGE_COUNT = 50;
|
||||
|
||||
export function buildParentByRoomId(rooms: Iterable<IHierarchyRoom>): Map<string, string> {
|
||||
const parentByRoomId = new Map<string, string>();
|
||||
for (const room of rooms) {
|
||||
const roomList = Array.from(rooms);
|
||||
for (let i = 0; i < roomList.length; i += 1) {
|
||||
const room = roomList[i];
|
||||
if (room?.room_id && Array.isArray(room.children_state)) {
|
||||
room.children_state.forEach((childState) => {
|
||||
if (childState?.type !== StateEvent.SpaceChild) return;
|
||||
|
||||
@@ -109,9 +109,12 @@ export function useOtherUserCollectibles(userId: string): CollectibleProfileFiel
|
||||
['avatar_decoration', data.avatar_decoration],
|
||||
] as const;
|
||||
|
||||
for (const [kind, collectible] of entries) {
|
||||
for (let i = 0; i < entries.length; i += 1) {
|
||||
const [kind, collectible] = entries[i];
|
||||
if (collectible) {
|
||||
for (const [role, mxc] of Object.entries(collectible.assets)) {
|
||||
const assetEntries = Object.entries(collectible.assets);
|
||||
for (let j = 0; j < assetEntries.length; j += 1) {
|
||||
const [role, mxc] = assetEntries[j];
|
||||
const blobUrl = await getProfileAssetUrl(mx, mxc, useAuthentication);
|
||||
if (blobUrl) urls[`${kind}:${role}`] = blobUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user