forked from mystiq/hydrogen-web
Review last checks
This commit is contained in:
parent
fb79326747
commit
302131c447
1 changed files with 6 additions and 7 deletions
|
@ -198,22 +198,21 @@ export class RoomViewModel extends ViewModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async joinRoom(roomName) {
|
|
||||||
}
|
|
||||||
|
|
||||||
async _processCommandJoin(roomName) {
|
async _processCommandJoin(roomName) {
|
||||||
try {
|
try {
|
||||||
const roomId = await this._options.client.session.joinRoom(roomName);
|
const roomId = await this._options.client.session.joinRoom(roomName);
|
||||||
const roomStatusObserver = await this._options.client.session.observeRoomStatus(roomId);
|
const roomStatusObserver = await this._options.client.session.observeRoomStatus(roomId);
|
||||||
await roomStatusObserver.waitFor(status => status === RoomStatus.Joined);
|
await roomStatusObserver.waitFor(status => status === RoomStatus.Joined);
|
||||||
this.navigation.push("room", roomId);
|
this.navigation.push("room", roomId);
|
||||||
} catch (exc) {
|
} catch (err) {
|
||||||
if ((exc.statusCode ?? exc.status) === 400) {
|
if ((exc.statusCode ?? exc.status) === 400) {
|
||||||
exc = new Error(`/join : '${roomName}' was not legal room ID or room alias`);
|
const exc = new Error(`/join : '${roomName}' was not legal room ID or room alias`);
|
||||||
} else if ((exc.statusCode ?? exc.status) === 404 || (exc.statusCode ?? exc.status) === 502 || exc.message == "Internal Server Error") {
|
} else if ((exc.statusCode ?? exc.status) === 404 || (exc.statusCode ?? exc.status) === 502 || exc.message == "Internal Server Error") {
|
||||||
exc = new Error(`/join : room '${roomName}' not found`);
|
const exc = new Error(`/join : room '${roomName}' not found`);
|
||||||
} else if ((exc.statusCode ?? exc.status) === 403) {
|
} else if ((exc.statusCode ?? exc.status) === 403) {
|
||||||
exc = new Error(`/join : you're not invited to join '${roomName}'`);
|
const exc = new Error(`/join : you're not invited to join '${roomName}'`);
|
||||||
|
} else {
|
||||||
|
const exc = err;
|
||||||
}
|
}
|
||||||
this._sendError = exc;
|
this._sendError = exc;
|
||||||
this._timelineError = null;
|
this._timelineError = null;
|
||||||
|
|
Loading…
Reference in a new issue