[FIX] Change default directory listing to Users (#1948)

* fix: change default directory listing to Users

* follow server settings

* Fix state to props

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Govind Dixit 2020-03-30 19:50:55 +05:30 committed by GitHub
parent 255254c285
commit 1ce0f6db59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -47,6 +47,9 @@ export default {
CROWD_Enable: {
type: 'valueAsBoolean'
},
Accounts_Directory_DefaultView: {
type: 'valueAsString'
},
FEDERATION_Enabled: {
type: 'valueAsBoolean'
},

View File

@ -45,7 +45,8 @@ class DirectoryView extends React.Component {
id: PropTypes.string,
token: PropTypes.string
}),
theme: PropTypes.string
theme: PropTypes.string,
directoryDefaultView: PropTypes.string
};
constructor(props) {
@ -57,7 +58,7 @@ class DirectoryView extends React.Component {
total: -1,
showOptionsDropdown: false,
globalUsers: true,
type: 'channels'
type: props.directoryDefaultView
};
}
@ -256,7 +257,8 @@ class DirectoryView extends React.Component {
const mapStateToProps = state => ({
baseUrl: state.server.server,
user: getUserSelector(state),
isFederationEnabled: state.settings.FEDERATION_Enabled
isFederationEnabled: state.settings.FEDERATION_Enabled,
directoryDefaultView: state.settings.Accounts_Directory_DefaultView
});
export default connect(mapStateToProps)(withTheme(DirectoryView));