diff --git a/frontend/ts/batch-timer.ts b/frontend/ts/batch-timer.ts index c15e2ac..ab5f735 100644 --- a/frontend/ts/batch-timer.ts +++ b/frontend/ts/batch-timer.ts @@ -12,7 +12,7 @@ export class BatchTimer { public queue(id: string, timeout: number){ this._timer = new Date().getTime() + timeout; this._batch.push(id); - setTimeout(this.checkBatch, timeout); + setTimeout(this.checkBatch.bind(this), timeout); } private checkBatch() { diff --git a/frontend/ts/thread-summary-element.ts b/frontend/ts/thread-summary-element.ts index 7579198..e5edff2 100644 --- a/frontend/ts/thread-summary-element.ts +++ b/frontend/ts/thread-summary-element.ts @@ -1,6 +1,7 @@ import util from "./util" import { Message, Author } from "./message" import { AdapterState } from "./adapter" +import { BatchTimer } from "./batch-timer" export class ThreadSummaryElement extends HTMLElement { static observedAttributes = [ "data-msg", "data-len", "data-author", "data-created", "data-latest", "data-new" ]; @@ -13,6 +14,8 @@ export class ThreadSummaryElement extends HTMLElement { private _latest: number = 0; private _new: boolean = false; + private _authorTimer: BatchTimer; + constructor() { super(); this.innerHTML = "