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