autopass 3.1.2 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +4 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -123,6 +123,7 @@ class Autopass extends ReadyResource {
123
123
  constructor(corestore, opts = {}) {
124
124
  super()
125
125
  this.router = new Router()
126
+ this.relayThrough = opts.relayThrough || null
126
127
  this.store = corestore
127
128
  this.swarm = opts.swarm || null
128
129
  this.base = null
@@ -244,6 +245,7 @@ class Autopass extends ReadyResource {
244
245
 
245
246
  const record = { id, invite, publicKey, expires }
246
247
  await this.base.append(encode('@autopass/add-invite', record))
248
+ if (this.member) await this.member.flushed()
247
249
  return z32.encode(record.invite)
248
250
  }
249
251
 
@@ -293,7 +295,8 @@ class Autopass extends ReadyResource {
293
295
  if (this.swarm === null) {
294
296
  this.swarm = new Hyperswarm({
295
297
  keyPair: await this.store.createKeyPair('hyperswarm'),
296
- bootstrap: this.bootstrap
298
+ bootstrap: this.bootstrap,
299
+ relayThrough: this.relayThrough
297
300
  })
298
301
  this.swarm.on('connection', (connection, peerInfo) => {
299
302
  this.base.replicate(connection)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autopass",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "brittle": "npx brittle test.js",