fix late initialization of InfoView component

This commit is contained in:
or-else
2025-09-24 19:38:29 +03:00
parent 679276c2e2
commit c70e5ebf7e
9 changed files with 25 additions and 10 deletions
+8 -1
View File
@@ -185,6 +185,7 @@ class InfoView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
previousMetaDesc: undefined,
previousSubsUpdated: undefined
};
this.propsUpdated = this.propsUpdated.bind(this);
this.resetSubs = this.resetSubs.bind(this);
this.resetDesc = this.resetDesc.bind(this);
this.resetTags = this.resetTags.bind(this);
@@ -203,7 +204,7 @@ class InfoView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
this.handleContextMenu = this.handleContextMenu.bind(this);
this.handleBackNavigate = this.handleBackNavigate.bind(this);
}
componentDidUpdate(props) {
propsUpdated(props) {
const topic = this.props.tinode.getTopic(props.topic);
if (!topic) {
return;
@@ -223,6 +224,12 @@ class InfoView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
this.resetTags(topic);
}
}
componentDidMount() {
this.propsUpdated(this.props);
}
componentDidUpdate(props) {
this.propsUpdated(props);
}
componentWillUnmount() {
const topic = this.props.tinode.getTopic(this.props.topic);
if (!topic) {