Skip to content

Commit

Permalink
Fix keysToKeep unused
Browse files Browse the repository at this point in the history
  • Loading branch information
1337LutZ committed Dec 2, 2024
1 parent 57dca3c commit d9f9772
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/core/cache_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export class CacheHandler<T> {
}

private keepMostRecent() {
if (this.data.size > 2) {
if (this.keysToKeep && this.data.size > this.keysToKeep) {
const keys = [...this.data.keys()];
const keysToRemove = keys.slice(0, keys.length - 2);
const keysToRemove = keys.slice(0, keys.length - this.keysToKeep);
keysToRemove.forEach(key => this.data.delete(key));
}
}
Expand Down

0 comments on commit d9f9772

Please sign in to comment.