Fix stuck on room loading

For fresh account, when "/room" ("/join" worked). Issue #76.
This commit is contained in:
N-Pex 2021-02-25 14:21:21 +01:00
parent b9783403fc
commit d32bc1134d
2 changed files with 11 additions and 6 deletions

View file

@ -418,7 +418,9 @@ export default {
return this.$matrix.currentRoom; return this.$matrix.currentRoom;
}, },
roomId() { roomId() {
if (!this.$matrix.ready) { if (!this.$matrix.ready && this.currentUser) {
// If we have a user already, wait for ready state. If not, we
// dont want to return here, because we want to redirect to "join".
return null; // Not ready yet... return null; // Not ready yet...
} }
if (this.room) { if (this.room) {

View file

@ -52,7 +52,7 @@
<v-card class="members ma-3" flat> <v-card class="members ma-3" flat>
<v-card-title class="h2" <v-card-title class="h2"
>Members<v-spacer></v-spacer> >Members<v-spacer></v-spacer>
<div>{{ room.getJoinedMemberCount() }}</div></v-card-title <div>{{ memberCount }}</div></v-card-title
> >
<v-card-text> <v-card-text>
<div <div
@ -241,10 +241,9 @@ export default {
watch: { watch: {
room: { room: {
handler(newVal, ignoredOldVal) { handler(ignoredNewVal, ignoredOldVal) {
console.log("RoomInfo: Current room changed"); console.log("RoomInfo: Current room changed");
this.memberCount = newVal.getJoinedMemberCount(); this.updateMemberCount();
this.updateQRCode(); this.updateQRCode();
}, },
}, },
@ -261,7 +260,11 @@ export default {
}, },
updateMemberCount() { updateMemberCount() {
this.memberCount = this.room.getJoinedMemberCount(); if (this.room) {
this.memberCount = this.room.getJoinedMemberCount();
} else {
this.memberCount = null;
}
}, },
updateQRCode() { updateQRCode() {