merge devel
This commit is contained in:
@@ -249,12 +249,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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-5
@@ -5289,11 +5289,15 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
||||
} else {
|
||||
this.postReadNotification(0);
|
||||
}
|
||||
if (topic && (this.state.topic != prevState.topic || !prevProps.ready)) {
|
||||
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) {
|
||||
if (topic._new && topic.isP2PType()) {
|
||||
topic.getMeta(topic.startMetaQuery().withDesc().build());
|
||||
} else {
|
||||
this.subscribe(topic);
|
||||
}
|
||||
} else if (topic.isSubscribed() && this.state.isReader && !prevState.isReader) {
|
||||
topic.getMeta(topic.startMetaQuery().withLaterData().build());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
-2
@@ -4058,8 +4058,9 @@ class Topic {
|
||||
return this._tinode.getMeta(this.name, params);
|
||||
}
|
||||
getMessagesPage(limit, forward) {
|
||||
let query = forward ? this.startMetaQuery().withLaterData(limit) : this.startMetaQuery().withEarlierData(limit);
|
||||
this._tinode._db.missingRanges(this.name, this._maxSeq, limit).then(ranges => console.log("missing range:", ranges));
|
||||
this._tinode._db.missingRanges(this.name, this._maxSeq, limit, forward ? this._maxSeq : undefined).then(ranges => {
|
||||
let query = forward ? this.startMetaQuery().withLaterData(limit) : this.startMetaQuery().withEarlierData(limit);
|
||||
});
|
||||
return this._loadMessages(this._tinode._db, query.extract('data')).then(count => {
|
||||
if (count == limit) {
|
||||
return Promise.resolve({
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user