Fix old event splicing
This commit is contained in:
parent
3b6821a423
commit
ed36a8a693
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ export class EventStore {
|
|||
private clearOld() {
|
||||
const now = Date.now();
|
||||
const firstCurrent = this.events.findIndex((v) => (now - v.at.getTime()) <= CURRENT_THRESHOLD * 1000);
|
||||
const deleted = this.events.splice(0, firstCurrent !== -1 ? firstCurrent : undefined);
|
||||
const deleted = this.events.splice(0, firstCurrent !== -1 ? firstCurrent : this.events.length);
|
||||
|
||||
for (const deletedEvent of deleted) {
|
||||
for (const listener of this.listeners) {
|
||||
|
|
Loading…
Reference in a new issue