Fixing 'this' for scheduled timeout

This commit is contained in:
Jonathan Putney
2019-11-19 15:31:18 -05:00
parent 7456c1cbc6
commit d3f7184507
4 changed files with 5 additions and 5 deletions

View File

@@ -907,7 +907,7 @@ export default class BaseAPI {
*/
scheduleCommit(when: number) {
this.clearScheduledCommit();
this.#timeout = setTimeout(this.scheduledCallback, when);
this.#timeout = setTimeout(this.scheduledCallback.bind(this), when);
this.apiLog('scheduleCommit', '', 'scheduled', global_constants.LOG_LEVEL_DEBUG);
}