Skip to content

Commit

Permalink
fix: sort talk conversations by most recent activity
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny committed Jan 28, 2025
1 parent 9f1ca85 commit a6f4916
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Editor/AddTalkModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<NcEmptyContent v-else-if="talkConversations.length === 0"
:description="t('calendar','No Talk room available')" />
<ul v-else>
<li v-for="conversation in talkConversations"
<li v-for="conversation in sortedTalkConversations"
:key="conversation.id"
:class="{ selected: selectedRoom && selectedRoom.id === conversation.id }"
class="talk-room-list__item"
Expand Down Expand Up @@ -100,6 +100,12 @@ export default {
},
computed: {
...mapStores(useCalendarObjectInstanceStore, ['calendarObjectInstance']),
/**
* @return {object[]} Talk conversations sorted by most recent activity
*/
sortedTalkConversations() {
return this.talkConversations.sort((a, b) => b.lastActivity - a.lastActivity)

Check failure on line 107 in src/components/Editor/AddTalkModal.vue

View workflow job for this annotation

GitHub Actions / NPM lint

Unexpected side effect in "sortedTalkConversations" computed property
},
},
async mounted() {
await this.fetchTalkConversations()
Expand Down

0 comments on commit a6f4916

Please sign in to comment.