Support MinimumHashtagLength setting (#2583)
* Support MinimumHashtagLength setting * Set default value if missing
This commit is contained in:
parent
a52bc4ca2e
commit
d852e0991f
2 changed files with 6 additions and 1 deletions
|
|
@ -3,16 +3,19 @@
|
|||
|
||||
import {connect} from 'react-redux';
|
||||
|
||||
import {getAutolinkedUrlSchemes} from 'mattermost-redux/selectors/entities/general';
|
||||
import {getAutolinkedUrlSchemes, getConfig} from 'mattermost-redux/selectors/entities/general';
|
||||
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
||||
import {getCurrentUserMentionKeys} from 'mattermost-redux/selectors/entities/users';
|
||||
|
||||
import Markdown from './markdown';
|
||||
|
||||
function mapStateToProps(state) {
|
||||
const {MinimumHashtagLength} = getConfig(state);
|
||||
|
||||
return {
|
||||
autolinkedUrlSchemes: getAutolinkedUrlSchemes(state),
|
||||
mentionKeys: getCurrentUserMentionKeys(state),
|
||||
minimumHashtagLength: MinimumHashtagLength ? parseInt(MinimumHashtagLength, 10) : 3,
|
||||
theme: getTheme(state),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ export default class Markdown extends PureComponent {
|
|||
isReplyPost: PropTypes.bool,
|
||||
isSearchResult: PropTypes.bool,
|
||||
mentionKeys: PropTypes.array.isRequired,
|
||||
minimumHashtagLength: PropTypes.number.isRequired,
|
||||
navigator: PropTypes.object.isRequired,
|
||||
onChannelLinkPress: PropTypes.func,
|
||||
onHashtagPress: PropTypes.func,
|
||||
|
|
@ -80,6 +81,7 @@ export default class Markdown extends PureComponent {
|
|||
createParser = () => {
|
||||
return new Parser({
|
||||
urlFilter: this.urlFilter,
|
||||
minimumHashtagLength: this.props.minimumHashtagLength,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue