Add notification count
Add count to tab title and room list. Issue #49.
This commit is contained in:
parent
9c9619fe1c
commit
ee3dd935be
4 changed files with 56 additions and 9 deletions
|
|
@ -3,9 +3,10 @@
|
|||
<v-subheader>ROOMS</v-subheader>
|
||||
<v-list-item-group v-model="currentRoomId" color="primary">
|
||||
<v-list-item v-for="room in $matrix.rooms" :key="room.roomId" :value="room.roomId">
|
||||
<v-list-item-avatar color="#e0e0e0">
|
||||
<v-list-item-avatar size="40" color="#e0e0e0">
|
||||
<v-img :src="room.avatar" />
|
||||
</v-list-item-avatar>
|
||||
<div class="room-list-notification-count">{{ notificationCount(room) }}</div>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>{{ room.summary.info.title }}</v-list-item-title>
|
||||
<v-list-item-subtitle>{{ room.topic }}</v-list-item-subtitle>
|
||||
|
|
@ -22,9 +23,15 @@ export default {
|
|||
name: "RoomList",
|
||||
|
||||
data: () => ({
|
||||
currentRoomId: -1,
|
||||
currentRoomId: null,
|
||||
}),
|
||||
|
||||
methods: {
|
||||
notificationCount(room) {
|
||||
return room.getUnreadNotificationCount('total') || 0;
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
currentRoomId() {
|
||||
this.$emit("close");
|
||||
|
|
@ -33,3 +40,7 @@ export default {
|
|||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/assets/css/chat.scss";
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue