From 1908c2d60882089f00494a30d538bac929ccf093 Mon Sep 17 00:00:00 2001 From: AlexeySafronov Date: Fri, 19 Mar 2021 21:11:22 +0300 Subject: [PATCH] Web: Files: Refactoring --- .../pages/Home/Section/Filter/index.js | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Filter/index.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Filter/index.js index 62e8a2d7a3..7e1169e16b 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Filter/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Filter/index.js @@ -258,30 +258,13 @@ class SectionFilterContent extends React.Component { return selectedFilterData; }; - needForUpdate = (currentProps, nextProps) => { - if (currentProps.language !== nextProps.language) { - return true; - } - return false; - }; - - // shouldComponentUpdate(nextProps, nextState) { - // return ( - // !equal(this.props.filter, nextProps.filter) || - // this.props.selectedFolderId !== nextProps.selectedFolderId || - // this.state.isReady !== nextState.isReady || - // this.props.viewAs !== nextProps.viewAs || - // this.props.firstLoad !== nextProps.firstLoad || - // this.props.sectionWidth !== nextProps.sectionWidth - // ); - // } - render() { //console.log("Filter render"); const selectedFilterData = this.getSelectedFilterData(); - const { t, language, firstLoad, sectionWidth } = this.props; + const { t, firstLoad, sectionWidth } = this.props; const filterColumnCount = window.innerWidth < 500 ? {} : { filterColumnCount: 3 }; + return firstLoad ? ( ) : ( @@ -296,8 +279,6 @@ class SectionFilterContent extends React.Component { directionAscLabel={t("DirectionAscLabel")} directionDescLabel={t("DirectionDescLabel")} placeholder={t("Search")} - needForUpdate={this.needForUpdate} - language={language} isReady={this.state.isReady} {...filterColumnCount} contextMenuHeader={t("AddFilter")} @@ -314,12 +295,10 @@ export default inject( const { user } = auth.userStore; const { customNames, culture } = auth.settingsStore; - const language = (user && user.cultureName) || culture || "en-US"; return { customNames, user, - language, firstLoad, selectedFolderId: selectedFolderStore.id, selectedItem: filter.selectedItem,