Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
Checks / checks (push) Successful in 2m11s
Trigger cinny-mobile / dispatch (push) Successful in 1s

This commit is contained in:
2026-11-01 04:23:53 +11:00
parent 3cd159a63e
commit a6ad8651b3
605 changed files with 11480 additions and 9125 deletions
@@ -1,8 +1,19 @@
import React, { useCallback } from 'react';
import { Box, config, Header, IconButton, Modal, Overlay, OverlayBackdrop, OverlayCenter, Scroll, Text } from 'folds';
import { Icon, Icons } from '../../components/icons';
import {
Box,
config,
Header,
IconButton,
Modal,
Overlay,
OverlayBackdrop,
OverlayCenter,
Scroll,
Text,
} from 'folds';
import FocusTrap from 'focus-trap-react';
import { useAtomValue } from 'jotai';
import { Icon, Icons } from '../../components/icons';
import { useAllJoinedRoomsSet, useGetRoom } from '../../hooks/useGetRoom';
import { SpaceProvider } from '../../hooks/useSpace';
import { CreateRoomForm } from './CreateRoom';
@@ -49,7 +60,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
canonical: true,
via: viaServers,
},
parentSubRoomId
parentSubRoomId,
);
// Set m.space.child on the parent room pointing to this sub-room
@@ -57,19 +68,17 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
parentSubRoomId,
StateEvent.SpaceChild,
{ via: viaServers },
newRoomId
newRoomId,
);
// Copy parent's join_rules to the sub-room
const parentJoinRulesEvent = parentRoom.currentState.getStateEvents(StateEvent.RoomJoinRules, '');
const parentJoinRulesEvent = parentRoom.currentState.getStateEvents(
StateEvent.RoomJoinRules,
'',
);
if (parentJoinRulesEvent) {
const joinRulesContent = parentJoinRulesEvent.getContent();
await mx.sendStateEvent(
newRoomId,
StateEvent.RoomJoinRules,
joinRulesContent,
''
);
await mx.sendStateEvent(newRoomId, StateEvent.RoomJoinRules, joinRulesContent, '');
}
// Add new room to parent's sub-rooms list
@@ -80,7 +89,12 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
children: [...currentChildren, newRoomId],
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await mx.sendStateEvent(parentSubRoomId, StateEvent.PaarrotSubRooms as any, newContent, '');
await mx.sendStateEvent(
parentSubRoomId,
StateEvent.PaarrotSubRooms as any,
newContent,
'',
);
// Also add sub-room to parent's space(s) for joining/permissions
// The UI will hide it from the top-level display and only show it nested
@@ -101,14 +115,14 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
StateEvent.SpaceChild as any,
{ via: spaceViaServers },
newRoomId
newRoomId,
);
} catch (spaceError) {
// eslint-disable-next-line no-console
console.warn(`Failed to add sub-room to space ${parentSpaceId}:`, spaceError);
}
}
})
}),
);
}
} catch (error) {
@@ -118,7 +132,7 @@ function CreateRoomModal({ state }: CreateRoomModalProps) {
}
closeDialog();
},
[mx, parentSubRoomId, parentRoom, roomToParents, closeDialog]
[mx, parentSubRoomId, parentRoom, roomToParents, closeDialog],
);
const modalTitle = parentSubRoomId ? 'New Sub-Room' : 'New Room';