Changed implementation to use initialstate

pull/1384/head
Kelrap 1 year ago
parent 9e6a3fd21c
commit ab7a8e2582

@ -84,6 +84,15 @@ class NewSpaceController extends State<NewSpace> {
), ),
); );
if (avatar != null) {
events.add(
StateEvent(
type: sdk.EventTypes.RoomAvatar,
content: {'url': avatarUrl.toString()},
),
);
}
// commenting out pangea room rules in spaces for now // commenting out pangea room rules in spaces for now
// if (rulesEditorKey.currentState?.rules != null) { // if (rulesEditorKey.currentState?.rules != null) {
// events.add(rulesEditorKey.currentState!.rules.toStateEvent); // events.add(rulesEditorKey.currentState!.rules.toStateEvent);
@ -198,10 +207,6 @@ class NewSpaceController extends State<NewSpace> {
space.updateRoomCapacity(capacity); space.updateRoomCapacity(capacity);
} }
if (avatar != null && space != null) {
space.setAvatar(MatrixFile(bytes: avatar, name: 'Avatar'));
}
final Room? room = Matrix.of(context).client.getRoomById(spaceId); final Room? room = Matrix.of(context).client.getRoomById(spaceId);
if (room == null) { if (room == null) {
ErrorHandler.logError( ErrorHandler.logError(

Loading…
Cancel
Save