Remove event id check in handleAuth since request/response might span multiple executors

This commit is contained in:
Jonathan Staab
2023-04-20 11:52:14 -05:00
parent fe23f28606
commit 7cfd022f16
3 changed files with 4 additions and 16 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "paravel",
"version": "0.1.13",
"version": "0.1.14",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "paravel",
"version": "0.1.13",
"version": "0.1.14",
"license": "MIT",
"dependencies": {
"husky": "^8.0.3",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "paravel",
"version": "0.1.13",
"version": "0.1.14",
"description": "Yet another toolkit for nostr",
"repository": {
"type": "git",
+1 -13
View File
@@ -55,19 +55,7 @@ export class Executor {
return {unsubscribe}
}
handleAuth({onAuth, onOk}) {
let event
const unsubscribe = this.target.bus.addListeners({
AUTH: async (url, challenge) => {
event = await onAuth(url, challenge)
},
OK: (url, id, ok, message) => {
if (id === event?.id) {
event = null
onOk(url, id, ok, message)
}
}
})
const unsubscribe = this.target.bus.addListeners({AUTH: onAuth, OK: onOk})
return {unsubscribe}
}