Join public room

Work on issue #9
This commit is contained in:
N-Pex 2020-11-19 22:48:08 +01:00
parent e7cd5db831
commit 43e876ba80
6 changed files with 92 additions and 43 deletions

View file

@ -21,6 +21,7 @@ export default {
data() {
return {
matrixClient: null,
matrixClientReady: false,
rooms: [],
}
},
@ -73,6 +74,7 @@ export default {
this.removeMatrixClientListeners(this.matrixClient);
this.matrixClient.stopClient();
this.matrixClient = null;
this.matrixClientReady = false;
localStorage.removeItem('user');
}
this.$store.commit("setCurrentRoomId", null);
@ -80,6 +82,8 @@ export default {
initClient() {
this.reloadRooms();
this.matrixClientReady = true;
this.matrixClient.emit('Matrix.initialized', this.matrixClient);
},
async getMatrixClient(user) {
@ -179,10 +183,10 @@ export default {
},
getRoom(roomId) {
if (this.matrixClient) {
return this.matrixClient.getRoom(roomId);
}
return null;
// if (this.matrixClient) {
// return this.matrixClient.getRoom(roomId);
// }
return this.rooms.find(room => room.roomId == roomId);
},
on(event, handler) {