Files
Desktop/ts/util/hasDraftAttachments.std.ts
Fedor Indutny 44076ece79 Rename files
2025-10-16 23:45:44 -07:00

20 lines
496 B
TypeScript

// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { AttachmentDraftType } from '../types/Attachment.std.js';
export function hasDraftAttachments(
draftAttachments: ReadonlyArray<AttachmentDraftType> | undefined,
options: { includePending: boolean }
): boolean {
if (!draftAttachments) {
return false;
}
if (options.includePending) {
return draftAttachments.length > 0;
}
return draftAttachments.some(item => !item.pending);
}