More work on chat header
This commit is contained in:
parent
059c84cb24
commit
7d3124c934
4 changed files with 48 additions and 37 deletions
|
|
@ -213,7 +213,6 @@ export default {
|
|||
|
||||
data() {
|
||||
return {
|
||||
room: null,
|
||||
events: [],
|
||||
currentInput: "",
|
||||
contactIsTyping: false,
|
||||
|
|
@ -250,8 +249,14 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
room() {
|
||||
return this.$matrix.currentRoom;
|
||||
},
|
||||
roomId() {
|
||||
return this.$matrix.currentRoomId;
|
||||
if (!this.room) {
|
||||
return null;
|
||||
}
|
||||
return this.room.roomId;
|
||||
},
|
||||
sendButtonDisabled() {
|
||||
return this.currentInput.length == 0;
|
||||
|
|
@ -259,24 +264,19 @@ export default {
|
|||
},
|
||||
|
||||
watch: {
|
||||
roomId: {
|
||||
handler(ignoredNewVal, ignoredOldVal) {
|
||||
room: {
|
||||
handler(room, ignoredOldVal) {
|
||||
console.log("Chat: Current room changed");
|
||||
|
||||
// Clear old events
|
||||
this.events = [];
|
||||
this.timelineWindow = null;
|
||||
this.contactIsTyping = false;
|
||||
|
||||
if (!this.roomId) {
|
||||
|
||||
if (!room) {
|
||||
return; // no room
|
||||
}
|
||||
|
||||
this.room = this.$matrix.getRoom(this.roomId);
|
||||
if (!this.room) {
|
||||
return; // Not found
|
||||
}
|
||||
|
||||
this.timelineWindow = new TimelineWindow(
|
||||
this.$matrix.matrixClient,
|
||||
this.room.getUnfilteredTimelineSet(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue