Less tricks, more clarity

This commit is contained in:
Markus Olsson 2020-12-22 12:22:08 +01:00
parent 83483a1872
commit 6e4ab3511f

View file

@ -119,7 +119,11 @@ export class AheadBehindStore {
this.workers.set(key, worker)
}
return worker.then(x => x !== null && !disposable.disposed && callback(x))
const aheadBehind = await worker
if (aheadBehind !== null && !disposable.disposed) {
callback(aheadBehind)
}
}).catch(e => log.error('Failed calculating ahead/behind status', e))
return disposable