diff --git a/extensions/git/src/decorators.ts b/extensions/git/src/decorators.ts index c4e46f3458e3e20f7a56183e46fa0e36872c148d..819f12659a848e227978fc7936cfd275f721d774 100644 --- a/extensions/git/src/decorators.ts +++ b/extensions/git/src/decorators.ts @@ -67,9 +67,8 @@ function _throttle(fn: Function, key: string): Function { this[currentKey] = fn.apply(this, args) as Promise; - done(this[currentKey]).then(() => { - this[currentKey] = undefined; - }); + const clear = () => this[currentKey] = undefined; + done(this[currentKey]).then(clear, clear); return this[currentKey]; };