mirror of https://github.com/waku-org/js-waku.git
Remove interval
This commit is contained in:
parent
f6aa758712
commit
064bad5a75
|
@ -46,20 +46,16 @@ function App() {
|
|||
if (!waku) return;
|
||||
if (wakuStatus !== 'Connected') return;
|
||||
|
||||
const interval = setInterval(() => {
|
||||
waku.store
|
||||
.queryHistory([ContentTopic])
|
||||
.catch((e) => {
|
||||
console.log('Failed to retrieve messages', e);
|
||||
})
|
||||
.then((retrievedMessages) => {
|
||||
const messages = retrievedMessages.map(decodeMessage).filter(Boolean);
|
||||
waku.store
|
||||
.queryHistory([ContentTopic])
|
||||
.catch((e) => {
|
||||
console.log('Failed to retrieve messages', e);
|
||||
})
|
||||
.then((retrievedMessages) => {
|
||||
const messages = retrievedMessages.map(decodeMessage).filter(Boolean);
|
||||
|
||||
setMessages(messages);
|
||||
});
|
||||
}, 10000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
setMessages(messages);
|
||||
});
|
||||
}, [waku, wakuStatus]);
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue