change community fetch
This commit is contained in:
parent
c84ed7ac7b
commit
d6c1ff0450
|
@ -79,10 +79,13 @@ export class Community {
|
||||||
|
|
||||||
await this.waku.store.queryHistory([this.communityContentTopic], {
|
await this.waku.store.queryHistory([this.communityContentTopic], {
|
||||||
decryptionKeys: [this.communityDecryptionKey],
|
decryptionKeys: [this.communityDecryptionKey],
|
||||||
|
// oldest message first
|
||||||
callback: wakuMessages => {
|
callback: wakuMessages => {
|
||||||
// todo: iterate from right
|
let index = wakuMessages.length
|
||||||
for (const wakuMessage of wakuMessages.reverse()) {
|
|
||||||
this.client.handleWakuMessage(wakuMessage)
|
// most recent page first
|
||||||
|
while (--index >= 0) {
|
||||||
|
this.client.handleWakuMessage(wakuMessages[index])
|
||||||
|
|
||||||
if (!this.communityMetadata) {
|
if (!this.communityMetadata) {
|
||||||
return shouldStop
|
return shouldStop
|
||||||
|
|
Loading…
Reference in New Issue