mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-04 19:56:45 +02:00
Fix /join <alias> command failing due to race condition (#31433)
* Explicitly pass via_servers in join room options * Fix test
This commit is contained in:
parent
e97de7d2ea
commit
3b0bc0bb4a
@ -445,13 +445,21 @@ export class RoomViewStore extends EventEmitter {
|
||||
this.setState(newState);
|
||||
|
||||
if (payload.auto_join) {
|
||||
this.dis?.dispatch<JoinRoomPayload>({
|
||||
const joinPayload: JoinRoomPayload = {
|
||||
...payload,
|
||||
action: Action.JoinRoom,
|
||||
roomId: payload.room_id,
|
||||
metricsTrigger: payload.metricsTrigger as JoinRoomPayload["metricsTrigger"],
|
||||
canAskToJoin: SettingsStore.getValue("feature_ask_to_join"),
|
||||
});
|
||||
};
|
||||
// Explicitly pass viaServers in case state doesn't contain the same due to
|
||||
// some race issues.
|
||||
if (payload.via_servers) {
|
||||
joinPayload.opts = {
|
||||
viaServers: payload.via_servers,
|
||||
};
|
||||
}
|
||||
this.dis?.dispatch<JoinRoomPayload>(joinPayload);
|
||||
}
|
||||
|
||||
if (room) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user