mirror of
https://github.com/melvincarvalho/nostrefresh.git
synced 2025-12-17 08:04:19 +01:00
refresh
This commit is contained in:
2
index.js
2
index.js
@@ -18,12 +18,12 @@
|
||||
socket.send(subscribe)
|
||||
}
|
||||
socket.onmessage = function (event) {
|
||||
console.log('refreshing in', t)
|
||||
const json = JSON.parse(event?.data)
|
||||
if (json[0] === 'EOSE') {
|
||||
console.log('EOSE')
|
||||
return
|
||||
}
|
||||
console.log('refreshing in', t)
|
||||
setTimeout(() => {
|
||||
document.location.reload()
|
||||
}, t * 1000)
|
||||
|
||||
Reference in New Issue
Block a user