better handling of unchanged tags

This commit is contained in:
or-else
2018-05-02 11:22:07 -07:00
parent 820a4081a1
commit 82cc9ebb09
+7 -2
View File
@@ -1647,6 +1647,10 @@
}; };
}, },
componentWillReceiveProps: function(nextProps){
this.setState({tags: nextProps.tags});
},
handleShowTagManager: function() { handleShowTagManager: function() {
this.setState({activated: true}); this.setState({activated: true});
}, },
@@ -1693,7 +1697,7 @@
tags.push(inp); tags.push(inp);
} }
this.props.onSubmit(tags); this.props.onSubmit(tags);
this.setState({activated: false, tagInput: '', tags: tags}); this.setState({activated: false, tagInput: '', tags: this.props.tags});
}, },
handleCancel: function() { handleCancel: function() {
@@ -4174,7 +4178,8 @@
handleUpdateAccountTagsRequest: function(tags) { handleUpdateAccountTagsRequest: function(tags) {
var instance = this; var instance = this;
Tinode.getMeTopic().setMeta({tags: tags}).catch(function(err) { Tinode.getMeTopic().setMeta({tags: tags})
.catch(function(err) {
instance.handleError(err.message, "err"); instance.handleError(err.message, "err");
}); });
}, },