fix: delay store query as there is an issue with libp2p peer store
This commit is contained in:
parent
568f3f83f2
commit
ee4119eefe
|
@ -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 (
|
||||
|
|
Loading…
Reference in New Issue