This commit is contained in:
or-else
2023-04-24 14:25:48 -07:00
parent a5c190f6db
commit 48405bcb94
13 changed files with 288 additions and 37 deletions
+11 -6
View File
@@ -245,12 +245,17 @@ class MessagesView extends React.Component {
this.postReadNotification(0);
}
if (topic && ((this.state.topic != prevState.topic) || !prevProps.ready)) {
// Don't immediately subscribe to a new p2p topic, wait for the first message.
if (topic._new && topic.isP2PType()) {
topic.getMeta(topic.startMetaQuery().withDesc().build());
} else {
this.subscribe(topic);
if (topic) {
if ((this.state.topic != prevState.topic) || !prevProps.ready) {
// Don't immediately subscribe to a new p2p topic, wait for the first message.
if (topic._new && topic.isP2PType()) {
topic.getMeta(topic.startMetaQuery().withDesc().build());
} else {
this.subscribe(topic);
}
} else if (topic.isSubscribed() && this.state.isReader && !prevState.isReader) {
// If reader status has changed and data became available.
topic.getMeta(topic.startMetaQuery().withLaterData().build());
}
}
}