fix: delay store query as there is an issue with libp2p peer store

This commit is contained in:
fryorcraken.eth 2022-08-31 12:56:54 +10:00
parent 568f3f83f2
commit ee4119eefe
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 14 additions and 9 deletions

View File

@ -58,15 +58,20 @@ function App() {
// 7 days/week, 24 hours/day, 60min/hour, 60secs/min, 100ms/sec
startTime.setTime(startTime.getTime() - 7 * 24 * 60 * 60 * 1000);
waku.store
.queryHistory([ContentTopic], {
callback: processMessages,
timeFilter: { startTime, endTime: new Date() },
})
.catch((e) => {
console.log("Failed to retrieve messages", e);
setWakuStatus("Error Encountered");
});
// TODO: Remove this timeout once https://github.com/status-im/js-waku/issues/913 is done
setTimeout(
() =>
waku.store
.queryHistory([ContentTopic], {
callback: processMessages,
timeFilter: { startTime, endTime: new Date() },
})
.catch((e) => {
console.log("Failed to retrieve messages", e);
setWakuStatus("Error Encountered");
}),
200
);
}, [waku, wakuStatus]);
return (