diff --git a/src/public/app/server_types.ts b/src/public/app/server_types.ts index 2b8459600..df6e1a7fc 100644 --- a/src/public/app/server_types.ts +++ b/src/public/app/server_types.ts @@ -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; hash: string; utcDateChanged?: string; diff --git a/src/public/app/services/froca_updater.ts b/src/public/app/services/froca_updater.ts index f10720de4..37f9d2814 100644 --- a/src/public/app/services/froca_updater.ts +++ b/src/public/app/services/froca_updater.ts @@ -290,14 +290,16 @@ function processAttachment(loadResults: LoadResults, ec: EntityChange) { return; } - if (attachment) { - attachment.update(ec.entity as FAttachmentRow); - } else { - const attachmentRow = ec.entity as FAttachmentRow; - const note = froca.notes[attachmentRow.ownerId]; + if (ec.entity) { + if (attachment) { + attachment.update(ec.entity as FAttachmentRow); + } else { + const attachmentRow = ec.entity as FAttachmentRow; + const note = froca.notes[attachmentRow.ownerId]; - if (note?.attachments) { - note.attachments.push(new FAttachment(froca, attachmentRow)); + if (note?.attachments) { + note.attachments.push(new FAttachment(froca, attachmentRow)); + } } }