Skip to content
Snippets Groups Projects
Commit 4ef96f04 authored by Daniel's avatar Daniel
Browse files

app/model: Hub: Fix reverted changes

parent b23a068d
Branches
No related merge requests found
......@@ -55,25 +55,41 @@ class Hub {
indexLambda(id, locations)
})
let userId = await promise
// Remove indexed locations.
unindexLambda(id, locations)
return userId
try {
return await promise
} finally {
// Remove indexed locations.
unindexLambda(id, locations)
delete this.drivers[id]
}
}
}
filter (location) {
return this.locations[location]
return [...this.locations[location] || []]
}
pick (id, userId) {
this.drivers[id].resolve(userId)
let handle = this.drivers[id]
if (handle) {
handle.resolve(userId)
return true
}
return false
}
reject (id, reason) {
this.drivers[id].reject(reason)
let handle = this.drivers[id]
if (handle) {
handle.reject(reason)
return true
}
return false
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment