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 { private load(): void {
if (!this.storage) { const messages = this.storage?.load() ?? [];
return;
}
const messages = this.storage.load();
if (messages.length > 0) { if (messages.length > 0) {
this.items = messages; this.items = messages;
} }