mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
fix: Fixes error in ChatList component (#8266)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1e70223ed7
commit
3c7854ccdf
@@ -410,8 +410,12 @@ export default {
|
|||||||
},
|
},
|
||||||
conversationListPagination() {
|
conversationListPagination() {
|
||||||
const conversationsPerPage = 25;
|
const conversationsPerPage = 25;
|
||||||
|
const hasChatsOnView =
|
||||||
|
this.chatsOnView &&
|
||||||
|
Array.isArray(this.chatsOnView) &&
|
||||||
|
!this.chatsOnView.length;
|
||||||
const isNoFiltersOrFoldersAndChatListNotEmpty =
|
const isNoFiltersOrFoldersAndChatListNotEmpty =
|
||||||
!this.hasAppliedFiltersOrActiveFolders && this.chatsOnView !== [];
|
!this.hasAppliedFiltersOrActiveFolders && hasChatsOnView;
|
||||||
const isUnderPerPage =
|
const isUnderPerPage =
|
||||||
this.chatsOnView.length < conversationsPerPage &&
|
this.chatsOnView.length < conversationsPerPage &&
|
||||||
this.activeAssigneeTabCount < conversationsPerPage &&
|
this.activeAssigneeTabCount < conversationsPerPage &&
|
||||||
@@ -516,10 +520,8 @@ export default {
|
|||||||
this.chatsOnView = this.conversationList;
|
this.chatsOnView = this.conversationList;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.setFiltersFromUISettings();
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.setFiltersFromUISettings();
|
||||||
this.$store.dispatch('setChatStatusFilter', this.activeStatus);
|
this.$store.dispatch('setChatStatusFilter', this.activeStatus);
|
||||||
this.$store.dispatch('setChatSortFilter', this.activeSortBy);
|
this.$store.dispatch('setChatSortFilter', this.activeSortBy);
|
||||||
this.resetAndFetchData();
|
this.resetAndFetchData();
|
||||||
@@ -550,8 +552,8 @@ export default {
|
|||||||
this.closeAdvanceFiltersModal();
|
this.closeAdvanceFiltersModal();
|
||||||
},
|
},
|
||||||
setFiltersFromUISettings() {
|
setFiltersFromUISettings() {
|
||||||
const { status, order_by: orderBy } =
|
const { conversations_filter_by: filterBy = {} } = this.uiSettings;
|
||||||
this.uiSettings.conversations_filter_by;
|
const { status, order_by: orderBy } = filterBy;
|
||||||
this.activeStatus = status || wootConstants.STATUS_TYPE.OPEN;
|
this.activeStatus = status || wootConstants.STATUS_TYPE.OPEN;
|
||||||
this.activeSortBy = orderBy || wootConstants.SORT_BY_TYPE.LATEST;
|
this.activeSortBy = orderBy || wootConstants.SORT_BY_TYPE.LATEST;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user