diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue index 84f4635da..a0b86176d 100644 --- a/app/javascript/dashboard/components/ChatList.vue +++ b/app/javascript/dashboard/components/ChatList.vue @@ -353,10 +353,11 @@ function setFiltersFromUISettings() { const { conversations_filter_by: filterBy = {} } = uiSettings.value; const { status, order_by: orderBy } = filterBy; activeStatus.value = status || wootConstants.STATUS_TYPE.OPEN; - activeSortBy.value = - Object.keys(wootConstants.SORT_BY_TYPE).find( - sortField => sortField === orderBy - ) || wootConstants.SORT_BY_TYPE.LAST_ACTIVITY_AT_DESC; + activeSortBy.value = Object.values(wootConstants.SORT_BY_TYPE).includes( + orderBy + ) + ? orderBy + : wootConstants.SORT_BY_TYPE.LAST_ACTIVITY_AT_DESC; } function emitConversationLoaded() {