fix: Do not leave old room if join new room failed
This commit is contained in:
parent
f9f13a14b4
commit
a5dc6db4e8
1 changed files with 10 additions and 10 deletions
|
|
@ -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…
Add table
Reference in a new issue