fix: MemLocalHistory uses optional chaining

This commit is contained in:
Danish Arora 2025-11-26 21:27:24 -05:00
parent 4757322489
commit ff8b4e5fdb
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E

View File

@ -159,11 +159,7 @@ export class MemLocalHistory implements ILocalHistory {
}
private load(): void {
if (!this.storage) {
return;
}
const messages = this.storage.load();
const messages = this.storage?.load() ?? [];
if (messages.length > 0) {
this.items = messages;
}