1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Merge pull request #2756 from vienai8d/saveTagsAlphabetically

Fix feature 'saveTagsAlphabetically'
This commit is contained in:
Junyoung Choi
2018-12-27 13:45:28 +09:00
committed by GitHub

View File

@@ -45,8 +45,14 @@ class TagSelect extends React.Component {
value = _.isArray(value)
? value.slice()
: []
value.push(newTag)
value = _.uniq(value)
if (!_.includes(value, newTag)) {
value.push(newTag)
}
if (this.props.saveTagsAlphabetically) {
value = _.sortBy(value)
}
this.setState({
newTag: ''