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(
|
final result = await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () => room.client.joinRoom(
|
future: () async {
|
||||||
room
|
final roomId = room.client.joinRoom(
|
||||||
.getState(EventTypes.RoomTombstone)!
|
room
|
||||||
.parsedTombstoneContent
|
.getState(EventTypes.RoomTombstone)!
|
||||||
.replacementRoom,
|
.parsedTombstoneContent
|
||||||
),
|
.replacementRoom,
|
||||||
);
|
);
|
||||||
await showFutureLoadingDialog(
|
await room.leave();
|
||||||
context: context,
|
return roomId;
|
||||||
future: room.leave,
|
},
|
||||||
);
|
);
|
||||||
if (result.error == null) {
|
if (result.error == null) {
|
||||||
context.go('/rooms/${result.result!}');
|
context.go('/rooms/${result.result!}');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue