fixed bugs in tags editing

This commit is contained in:
or-else
2021-08-18 19:51:19 -07:00
parent 529486feb3
commit 2cc2258682
12 changed files with 211 additions and 88 deletions
+6 -4
View File
@@ -28,12 +28,13 @@ export default class TopicDescEdit extends React.Component {
private: topic.private ? topic.private.comment : null,
description: topic.public ? topic.public.note : undefined,
avatar: makeImageUrl(topic.public ? topic.public.photo : null),
tags: topic.tags(),
tags: topic.tags() || [],
newAvatar: null,
newAvatarMime: null,
previousOnTags: topic.onTagsUpdated
newAvatarMime: null
};
this.previousOnTags = null;
this.tnNewTags = this.tnNewTags.bind(this);
this.handleFullNameUpdate = this.handleFullNameUpdate.bind(this);
this.handleImageUpdated = this.handleImageUpdated.bind(this);
@@ -47,12 +48,13 @@ export default class TopicDescEdit extends React.Component {
componentDidMount() {
const topic = this.props.tinode.getTopic(this.props.topic);
this.previousOnTags = topic.onTagsUpdated;
topic.onTagsUpdated = this.tnNewTags;
}
componentWillUnmount() {
const topic = this.props.tinode.getTopic(this.props.topic);
topic.onTagsUpdated = this.state.previousOnTags;
topic.onTagsUpdated = this.previousOnTags;
}
tnNewTags(tags) {