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 authored and backportbot[bot] committed Jan 28, 2025
1 parent 237083f commit 0418668
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']),
/**

Check warning on line 103 in src/components/Editor/AddTalkModal.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/AddTalkModal.vue#L103

Added line #L103 was not covered by tests
* @return {object[]} Talk conversations sorted by most recent activity
*/
sortedTalkConversations() {
return this.talkConversations.toSorted((a, b) => b.lastActivity - a.lastActivity)
},

Check warning on line 108 in src/components/Editor/AddTalkModal.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/AddTalkModal.vue#L106-L108

Added lines #L106 - L108 were not covered by tests
},
async mounted() {
await this.fetchTalkConversations()
Expand Down

0 comments on commit 0418668

Please sign in to comment.