mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
fix(client): undefined entity in some cases
This commit is contained in:
parent
1e182f5820
commit
d684440c1f
@ -1,12 +1,16 @@
|
||||
import type { EntityRowNames } from "./services/load_results.js";
|
||||
|
||||
interface Entity {
|
||||
isDeleted?: boolean;
|
||||
}
|
||||
|
||||
// TODO: Deduplicate with src/services/entity_changes_interface.ts
|
||||
export interface EntityChange {
|
||||
id?: number | null;
|
||||
noteId?: string;
|
||||
entityName: EntityRowNames;
|
||||
entityId: string;
|
||||
entity?: any;
|
||||
entity?: Entity;
|
||||
positions?: Record<string, number>;
|
||||
hash: string;
|
||||
utcDateChanged?: string;
|
||||
|
@ -290,6 +290,7 @@ function processAttachment(loadResults: LoadResults, ec: EntityChange) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ec.entity) {
|
||||
if (attachment) {
|
||||
attachment.update(ec.entity as FAttachmentRow);
|
||||
} else {
|
||||
@ -300,6 +301,7 @@ function processAttachment(loadResults: LoadResults, ec: EntityChange) {
|
||||
note.attachments.push(new FAttachment(froca, attachmentRow));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadResults.addAttachmentRow(attachmentEntity);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user