Improve claiming of promise.follow

This commit is contained in:
Andre Staltz 2024-03-08 15:55:32 +02:00
parent af088ba143
commit 9da1176e5f
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 1 additions and 1 deletions

View File

@ -253,9 +253,9 @@ async function handlePPPPPUri(ev, uri) {
// eslint-disable-next-line no-loop-func // eslint-disable-next-line no-loop-func
peer.addListener('rpc:connect', function onConnect(rpc) { peer.addListener('rpc:connect', function onConnect(rpc) {
if (rpc.shse.pubkey === issuerPubkey) { if (rpc.shse.pubkey === issuerPubkey) {
peer.removeListener('rpc:connect', onConnect)
rpc.promise.follow(command.token, globalAccountID, (err) => { rpc.promise.follow(command.token, globalAccountID, (err) => {
if (err) return console.error('Failed to use follow promise', err) if (err) return console.error('Failed to use follow promise', err)
peer.removeListener('rpc:connect', onConnect)
}) })
} }
}) })