diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js index 51847fba86..08ad23cc85 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js @@ -1470,7 +1470,7 @@ class SectionBodyContent extends React.Component { editingId === item.id && item.fileExst === fileAction.extension; const contextOptionsProps = - contextOptions && contextOptions.length > 0 + !isEdit && contextOptions && contextOptions.length > 0 ? { contextOptions: this.getFilesContextOptions( contextOptions, @@ -1480,7 +1480,7 @@ class SectionBodyContent extends React.Component { : {}; const checkedProps = isEdit || item.id <= 0 ? {} : { checked }; const element = this.getItemIcon(item, isEdit || item.id <= 0); - const sharedButton = this.getSharedButton(); + const sharedButton = (isEdit || item.id <= 0) ? null : this.getSharedButton(); const displayShareButton = widthProp > 500 ? '96px' : '26px'; let classNameProp = isFolder && item.access < 2 && !isRecycleBin ? { className: " dropable" } : { className: "" }; diff --git a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js index 5160c7f5d1..793327a824 100644 --- a/products/ASC.People/Client/src/components/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js +++ b/products/ASC.People/Client/src/components/pages/Profile/Section/Body/ProfileInfo/ProfileInfo.js @@ -14,7 +14,7 @@ import { connect } from "react-redux"; import { updateProfileCulture } from "../../../../../../store/profile/actions"; const { resendUserInvites } = api.people; -const { getCurrentCustomSchema, getModules } = store.auth.actions; + const InfoContainer = styled.div` margin-bottom: 24px; @@ -142,22 +142,12 @@ class ProfileInfo extends React.PureComponent { console.log("onLanguageSelect", language); const { profile, - updateProfileCulture, - nameSchemaId, - getModules, - getCurrentCustomSchema, + updateProfileCulture } = this.props; if (profile.cultureName === language.key) return; updateProfileCulture(profile.id, language.key) - .then(() => { - if (!nameSchemaId) return getModules(); - return ( - axios.all([getModules(), getCurrentCustomSchema(nameSchemaId)]), - console.log("Update getModules", getModules()) - ); - }) .catch((err) => console.log(err)); }; @@ -339,7 +329,7 @@ class ProfileInfo extends React.PureComponent { } function mapStateToProps(state) { - const { customNames, nameSchemaId } = state.auth.settings; + const { customNames } = state.auth.settings; const { groupCaption, regDateCaption, @@ -354,13 +344,10 @@ function mapStateToProps(state) { userPostCaption, userCaption, guestCaption, - nameSchemaId, }; } const mapDispatchToProps = (dispatch) => { return { - getModules: () => getModules(dispatch), - getCurrentCustomSchema: (id) => getCurrentCustomSchema(dispatch, id), updateProfileCulture: (id, culture) => dispatch(updateProfileCulture(id, culture)), }; diff --git a/products/ASC.People/Client/src/store/profile/actions.js b/products/ASC.People/Client/src/store/profile/actions.js index b84158b972..c939184589 100644 --- a/products/ASC.People/Client/src/store/profile/actions.js +++ b/products/ASC.People/Client/src/store/profile/actions.js @@ -81,10 +81,23 @@ export function updateProfile(profile) { }; } export function updateProfileCulture(id, culture) { - return (dispatch) => { + return (dispatch, getState) => { + return api.people.updateUserCulture(id, culture).then((user) => { dispatch(setCurrentUser(user)); return dispatch(setProfile(user)); + }) + .then(() => caches.delete("api-cache")) + .then(() => { + const { getCurrentCustomSchema, getModules } = store.auth.actions; + const state = getState(); + const { nameSchemaId } = state.auth.settings; + + if (!nameSchemaId) return getModules(); + + const requests = [(getModules(dispatch)), (getCurrentCustomSchema(dispatch, nameSchemaId))]; + + return Promise.all(requests); }); }; }