mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-13 04:13:19 +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";
|
import type { EntityRowNames } from "./services/load_results.js";
|
||||||
|
|
||||||
|
interface Entity {
|
||||||
|
isDeleted?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Deduplicate with src/services/entity_changes_interface.ts
|
// TODO: Deduplicate with src/services/entity_changes_interface.ts
|
||||||
export interface EntityChange {
|
export interface EntityChange {
|
||||||
id?: number | null;
|
id?: number | null;
|
||||||
noteId?: string;
|
noteId?: string;
|
||||||
entityName: EntityRowNames;
|
entityName: EntityRowNames;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
entity?: any;
|
entity?: Entity;
|
||||||
positions?: Record<string, number>;
|
positions?: Record<string, number>;
|
||||||
hash: string;
|
hash: string;
|
||||||
utcDateChanged?: string;
|
utcDateChanged?: string;
|
||||||
|
@ -290,6 +290,7 @@ function processAttachment(loadResults: LoadResults, ec: EntityChange) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ec.entity) {
|
||||||
if (attachment) {
|
if (attachment) {
|
||||||
attachment.update(ec.entity as FAttachmentRow);
|
attachment.update(ec.entity as FAttachmentRow);
|
||||||
} else {
|
} else {
|
||||||
@ -300,6 +301,7 @@ function processAttachment(loadResults: LoadResults, ec: EntityChange) {
|
|||||||
note.attachments.push(new FAttachment(froca, attachmentRow));
|
note.attachments.push(new FAttachment(froca, attachmentRow));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
loadResults.addAttachmentRow(attachmentEntity);
|
loadResults.addAttachmentRow(attachmentEntity);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user