Roomllist: sorty by recent activity and room with notification

This commit is contained in:
10G Meow 2024-02-03 14:33:42 +02:00
parent 63810b0208
commit d1dde1baf4

View file

@ -90,7 +90,12 @@ export default {
return this.sortItemsOnName(this.$matrix.invites);
},
joinedRooms() {
return this.sortItemsOnName(this.$matrix.joinedRooms);
// show room with notification on top, followed by room decending order by active Timestamp
return [...this.$matrix.joinedRooms].sort((a, b) => {
if (this.notificationCount(a)) return -1;
if (this.notificationCount(b)) return 1;
return b.getLastActiveTimestamp() - a.getLastActiveTimestamp()
});
},
},
methods: {