From 82cc9ebb09713b6fc9dd7eb4030ba3e60c17590f Mon Sep 17 00:00:00 2001 From: or-else Date: Wed, 2 May 2018 11:22:07 -0700 Subject: [PATCH] better handling of unchanged tags --- index.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 0f967ce4..bd02cfb7 100644 --- a/index.html +++ b/index.html @@ -1647,6 +1647,10 @@ }; }, + componentWillReceiveProps: function(nextProps){ + this.setState({tags: nextProps.tags}); + }, + handleShowTagManager: function() { this.setState({activated: true}); }, @@ -1693,7 +1697,7 @@ tags.push(inp); } this.props.onSubmit(tags); - this.setState({activated: false, tagInput: '', tags: tags}); + this.setState({activated: false, tagInput: '', tags: this.props.tags}); }, handleCancel: function() { @@ -4174,9 +4178,10 @@ handleUpdateAccountTagsRequest: function(tags) { var instance = this; - Tinode.getMeTopic().setMeta({tags: tags}).catch(function(err) { - instance.handleError(err.message, "err"); - }); + Tinode.getMeTopic().setMeta({tags: tags}) + .catch(function(err) { + instance.handleError(err.message, "err"); + }); }, // User chose Settings menu item.