Remove interval

This commit is contained in:
Franck Royer 2021-09-03 17:06:13 +10:00
parent f6aa758712
commit 064bad5a75
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 9 additions and 13 deletions

View File

@ -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 (