When a parent is added to new chat, load before opening invite page (#3497)
* When a parent is added to new chat, load before opening invite page * chore: only wait for new group in sync after adding to space if space parents list is empty --------- Co-authored-by: ggurdin <ggurdin@gmail.com>
This commit is contained in:
parent
3af7afd8ab
commit
e59e314628
2 changed files with 6 additions and 12 deletions
|
|
@ -178,6 +178,9 @@ class NewGroupController extends State<NewGroup> {
|
|||
try {
|
||||
final space = client.getRoomById(widget.spaceId!);
|
||||
await space?.addToSpace(room.id);
|
||||
if (room.pangeaSpaceParents.isEmpty) {
|
||||
await client.waitForRoomInSync(roomId);
|
||||
}
|
||||
} catch (err) {
|
||||
ErrorHandler.logError(
|
||||
e: "Failed to add room to space",
|
||||
|
|
|
|||
|
|
@ -162,18 +162,9 @@ class PangeaInvitationSelectionController
|
|||
Room? get _room => Matrix.of(context).client.getRoomById(widget.roomId);
|
||||
|
||||
Room? get spaceParent {
|
||||
final spaceParents = _room?.spaceParents;
|
||||
if (spaceParents == null || spaceParents.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final client = Matrix.of(context).client;
|
||||
for (final parent in spaceParents) {
|
||||
if (parent.roomId == null) continue;
|
||||
final space = client.getRoomById(parent.roomId!);
|
||||
if (space != null) return space;
|
||||
}
|
||||
return null;
|
||||
final parents = _room?.pangeaSpaceParents;
|
||||
if (parents == null || parents.isEmpty) return null;
|
||||
return parents.first;
|
||||
}
|
||||
|
||||
List<InvitationFilter> get availableFilters => InvitationFilter.values
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue