Add notification count

Add count to tab title and room list. Issue #49.
This commit is contained in:
N-Pex 2021-02-17 10:43:42 +01:00
parent 9c9619fe1c
commit ee3dd935be
4 changed files with 56 additions and 9 deletions

View file

@ -25,20 +25,26 @@ export default {
currentUser() {
return this.$store.state.auth.user;
},
},
watch: {
'$route' (to, ignoredFrom) {
title() {
var title = "Keanu Weblite";
if (to.meta.title) {
title += " - " + to.meta.title;
if (this.$matrix.notificationCount > 0) {
title += " [" + this.$matrix.notificationCount + "]";
}
if (to.meta.includeRoom) {
if (this.$route.meta.title) {
title += " - " + this.$route.meta.title;
}
if (this.$route.meta.includeRoom) {
if (this.$matrix.currentRoom) {
title += " - " + (this.$matrix.currentRoom.summary.info.title || this.$matrix.currentRoom.roomId);
} else if (this.$matrix.currentRoomId) {
title += " - " + (this.$matrix.currentRoomId);
}
}
return title;
}
},
watch: {
title(title) {
document.title = title;
},
currentUser: {