signal-desktop/ts/util/attachments/markAttachmentAsPermanentlyErrored.ts

19 lines
442 B
TypeScript
Raw Normal View History

2025-03-24 23:34:58 -07:00
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { omit } from 'lodash';
import { type AttachmentType } from '../../types/Attachment';
export function markAttachmentAsPermanentlyErrored(
2025-03-25 15:59:34 -07:00
attachment: AttachmentType,
{ backfillError }: { backfillError: boolean }
2025-03-24 23:34:58 -07:00
): AttachmentType {
2025-03-25 15:59:34 -07:00
return {
...omit(attachment, ['key', 'id']),
pending: false,
error: true,
backfillError,
};
2025-03-24 23:34:58 -07:00
}