fix: Do not leave old room if join new room failed

pull/1552/head
Krille 2 months ago
parent f9f13a14b4
commit a5dc6db4e8
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -1061,16 +1061,16 @@ class ChatController extends State<ChatPageWithRoom>
}
final result = await showFutureLoadingDialog(
context: context,
future: () => room.client.joinRoom(
room
.getState(EventTypes.RoomTombstone)!
.parsedTombstoneContent
.replacementRoom,
),
);
await showFutureLoadingDialog(
context: context,
future: room.leave,
future: () async {
final roomId = room.client.joinRoom(
room
.getState(EventTypes.RoomTombstone)!
.parsedTombstoneContent
.replacementRoom,
);
await room.leave();
return roomId;
},
);
if (result.error == null) {
context.go('/rooms/${result.result!}');

Loading…
Cancel
Save