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
+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}
}