another fix for #124

This commit is contained in:
or-else
2023-04-28 12:48:16 -07:00
parent 3ac895ec66
commit 3689b5d527
5 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -253,12 +253,12 @@ class MessagesView extends React.Component {
} }
if (topic) { if (topic) {
if ((this.state.topic != prevState.topic) || !prevProps.ready) { if ((this.state.topic != prevState.topic) || (this.props.myUserId && !prevProps.myUserId)) {
// Don't immediately subscribe to a new p2p topic, wait for the first message. // Don't immediately subscribe to a new p2p topic, wait for the first message.
const newTopic = (this.props.newTopicParams && this.props.newTopicParams._topicName == this.props.topic); const newTopic = (this.props.newTopicParams && this.props.newTopicParams._topicName == this.props.topic);
if (topic.isP2PType() && newTopic && !IMMEDIATE_P2P_SUBSCRIPTION) { if (topic.isP2PType() && newTopic && !IMMEDIATE_P2P_SUBSCRIPTION) {
topic.getMeta(topic.startMetaQuery().withDesc().build()); topic.getMeta(topic.startMetaQuery().withDesc().build());
} else { } else if (this.props.myUserId) {
this.subscribe(topic); this.subscribe(topic);
} }
} else if (topic.isSubscribed() && this.state.isReader && !prevState.isReader) { } else if (topic.isSubscribed() && this.state.isReader && !prevState.isReader) {
+2 -2
View File
@@ -5292,11 +5292,11 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
} }
} }
if (topic) { if (topic) {
if (this.state.topic != prevState.topic || !prevProps.ready) { if (this.state.topic != prevState.topic || this.props.myUserId && !prevProps.myUserId) {
const newTopic = this.props.newTopicParams && this.props.newTopicParams._topicName == this.props.topic; const newTopic = this.props.newTopicParams && this.props.newTopicParams._topicName == this.props.topic;
if (topic.isP2PType() && newTopic && !_config_js__WEBPACK_IMPORTED_MODULE_17__.IMMEDIATE_P2P_SUBSCRIPTION) { if (topic.isP2PType() && newTopic && !_config_js__WEBPACK_IMPORTED_MODULE_17__.IMMEDIATE_P2P_SUBSCRIPTION) {
topic.getMeta(topic.startMetaQuery().withDesc().build()); topic.getMeta(topic.startMetaQuery().withDesc().build());
} else { } else if (this.props.myUserId) {
this.subscribe(topic); this.subscribe(topic);
} }
} else if (topic.isSubscribed() && this.state.isReader && !prevState.isReader) { } else if (topic.isSubscribed() && this.state.isReader && !prevState.isReader) {
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long