parent
50ae081ea8
commit
6608f0c8ce
7 changed files with 24 additions and 12 deletions
|
|
@ -337,7 +337,10 @@ export default {
|
|||
watch: {
|
||||
room: {
|
||||
immediate: true,
|
||||
handler(room, ignoredOldVal) {
|
||||
handler(room, oldRoom) {
|
||||
if (room == oldRoom) {
|
||||
return; // No change.
|
||||
}
|
||||
console.log("Chat: Current room changed");
|
||||
|
||||
// Clear old events
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export default {
|
|||
.then(() => {
|
||||
console.log("Left room");
|
||||
this.$matrix.matrixClient.store.removeRoom(roomId);
|
||||
this.$matrix.setCurrentRoomId(null);
|
||||
this.$navigation.push({name:'Chat'}, -1);
|
||||
})
|
||||
.catch(err => {
|
||||
console.log("Error leaving", err);
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@
|
|||
|
||||
<script>
|
||||
import User from "../models/user";
|
||||
import util from "../plugins/utils";
|
||||
|
||||
export default {
|
||||
name: "Join",
|
||||
|
|
@ -92,7 +93,7 @@ export default {
|
|||
const room = self.$matrix.getRoom(self.roomId);
|
||||
if (room && room.hasMembershipState(self.currentUser.user_id, "join")) {
|
||||
// Yes, go to room
|
||||
self.$navigation.push({ name: "Chat" }, -1);
|
||||
self.$navigation.push({ name: 'Chat', params: { roomId: util.sanitizeRoomId(self.roomId) }}, -1);
|
||||
return;
|
||||
}
|
||||
this.waitingForMembership = false;
|
||||
|
|
@ -144,11 +145,10 @@ export default {
|
|||
return this.$matrix.matrixClient.joinRoom(this.roomId);
|
||||
})
|
||||
.then((room) => {
|
||||
this.$matrix.setCurrentRoomId(room.roomId);
|
||||
this.loading = false;
|
||||
this.loadingMessage = null;
|
||||
this.$nextTick(() => {
|
||||
this.$navigation.push({ name: "Chat" }, -1);
|
||||
this.$navigation.push({ name: "Chat", params: { roomId: room.roomId }}, -1);
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export default {
|
|||
},
|
||||
created() {
|
||||
if (this.loggedIn) {
|
||||
this.$navigation.push({name: "Chat"}, -1);
|
||||
this.$navigation.push({name: "Chat", params: { roomId: null }}, -1);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -114,7 +114,7 @@ export default {
|
|||
this.loading = true;
|
||||
this.$store.dispatch("auth/login", this.user).then(
|
||||
() => {
|
||||
this.$navigation.push({name: "Chat"}, -1);
|
||||
this.$navigation.push({name: "Chat", params: { roomId: null }}, -1);
|
||||
},
|
||||
(error) => {
|
||||
this.loading = false;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export default {
|
|||
watch: {
|
||||
currentRoomId() {
|
||||
this.$emit("close");
|
||||
this.$matrix.setCurrentRoomId(this.currentRoomId);
|
||||
this.$navigation.push({name: 'Chat', params: { roomId: this.currentRoomId }}, -1);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue