From 4919b486ff0799fc323ec2ebbd0f9887d22a39ce Mon Sep 17 00:00:00 2001 From: volodymyr Date: Fri, 15 Dec 2023 15:55:21 +0200 Subject: [PATCH] fix: crm contacrs sort fix [WTEL-4060] --- .../TableStoreModule/store/TableStoreModule.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/modules/TableStoreModule/store/TableStoreModule.js b/src/modules/TableStoreModule/store/TableStoreModule.js index 0ed7d4a6..8deac2f9 100644 --- a/src/modules/TableStoreModule/store/TableStoreModule.js +++ b/src/modules/TableStoreModule/store/TableStoreModule.js @@ -122,12 +122,15 @@ export default class TableStoreModule extends BaseStoreModule { }); }, UPDATE_HEADER_SORT: (context, { header, nextSortOrder }) => { - const headers = context.state.headers.map((oldHeader) => ({ - ...oldHeader, - sort: oldHeader.field === header.field - ? nextSortOrder - : SortSymbols.NONE, - })); + const headers = context.state.headers.map((oldHeader) => { + const sortFieldValue = oldHeader?.sort; + return { + ...oldHeader, + sort: oldHeader.field === header.field + ? nextSortOrder + : sortFieldValue, + }; + }); context.commit('SET_HEADERS', headers); }, PATCH_ITEM_PROPERTY: async (context, {