Merge branch '577-sort-room-list-by-more-recent-activity' into 'dev'

RoomList: sort by recent activity and room with notification

See merge request keanuapp/keanuapp-weblite!277
This commit is contained in:
N Pex 2024-02-05 14:37:44 +00:00
commit 9c3f791d52

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: {