autopass 3.1.3 → 3.1.5
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.
- package/index.js +2 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -237,6 +237,7 @@ class Autopass extends ReadyResource {
|
|
|
237
237
|
if (this.opened === false) await this.ready()
|
|
238
238
|
const existing = await this.base.view.findOne('@autopass/invite', {})
|
|
239
239
|
if (existing) {
|
|
240
|
+
if (this.member) await this.member.flushed()
|
|
240
241
|
return z32.encode(existing.invite)
|
|
241
242
|
}
|
|
242
243
|
const { id, invite, publicKey, expires } = BlindPairing.createInvite(
|
|
@@ -245,6 +246,7 @@ class Autopass extends ReadyResource {
|
|
|
245
246
|
|
|
246
247
|
const record = { id, invite, publicKey, expires }
|
|
247
248
|
await this.base.append(encode('@autopass/add-invite', record))
|
|
249
|
+
if (this.member) await this.member.flushed()
|
|
248
250
|
return z32.encode(record.invite)
|
|
249
251
|
}
|
|
250
252
|
|