From 1ce0f6db59f3b5ac91b394f9e9f44a7f15dee197 Mon Sep 17 00:00:00 2001 From: Govind Dixit Date: Mon, 30 Mar 2020 19:50:55 +0530 Subject: [PATCH] [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 --- app/constants/settings.js | 3 +++ app/views/DirectoryView/index.js | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/constants/settings.js b/app/constants/settings.js index 513ff5f34..2b26af320 100644 --- a/app/constants/settings.js +++ b/app/constants/settings.js @@ -47,6 +47,9 @@ export default { CROWD_Enable: { type: 'valueAsBoolean' }, + Accounts_Directory_DefaultView: { + type: 'valueAsString' + }, FEDERATION_Enabled: { type: 'valueAsBoolean' }, diff --git a/app/views/DirectoryView/index.js b/app/views/DirectoryView/index.js index 51c7b4f2b..e54f966c9 100644 --- a/app/views/DirectoryView/index.js +++ b/app/views/DirectoryView/index.js @@ -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));