Reset XP counter when API call is accepted

This commit is contained in:
Mikko Ahlroth
2017-08-27 20:54:58 +03:00
committed by Juha Ristolainen
parent ac731b06ed
commit 23466f311e
2 changed files with 9 additions and 3 deletions

View File

@@ -63,7 +63,13 @@ export class XpCounter {
}
this.updateTimeout = setTimeout(() => {
this.api.sendUpdate(this.pulse);
const promise = this.api.sendUpdate(this.pulse);
if (promise !== null) {
promise.then(() => {
this.updateStatusBar(show, `${this.pulse.getXP(document.languageId)}`);
});
}
}, this.UPDATE_DELAY);
}