Skip to content

Commit 3ab506e

Browse files
authored
Merge pull request #2756 from vienai8d/saveTagsAlphabetically
Fix feature 'saveTagsAlphabetically'
2 parents 13c2f47 + 6e8fe73 commit 3ab506e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

browser/main/Detail/TagSelect.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ class TagSelect extends React.Component {
4545
value = _.isArray(value)
4646
? value.slice()
4747
: []
48-
value.push(newTag)
49-
value = _.uniq(value)
48+
49+
if (!_.includes(value, newTag)) {
50+
value.push(newTag)
51+
}
52+
53+
if (this.props.saveTagsAlphabetically) {
54+
value = _.sortBy(value)
55+
}
5056

5157
this.setState({
5258
newTag: ''

0 commit comments

Comments
 (0)