An initial read forces gun to connect to peers
This commit is contained in:
parent
ac2ae7c2f8
commit
22b77e0b2f
1 changed files with 6 additions and 0 deletions
|
|
@ -85,6 +85,12 @@ const handleMsg = async msg => {
|
||||||
if (msg.type === 'init') {
|
if (msg.type === 'init') {
|
||||||
gun = /** @type {any} */ (new Gun(msg.opts))
|
gun = /** @type {any} */ (new Gun(msg.opts))
|
||||||
|
|
||||||
|
// Force gun to connect to peers
|
||||||
|
gun
|
||||||
|
.get('foo')
|
||||||
|
.get('baz')
|
||||||
|
.once()
|
||||||
|
|
||||||
let currentPeers = ''
|
let currentPeers = ''
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
const newPeers = JSON.stringify(
|
const newPeers = JSON.stringify(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue