Files
Desktop/ts/util/hasDraft.std.ts
2026-03-11 13:11:51 -07:00

18 lines
482 B
TypeScript

// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ConversationAttributesType } from '../model-types.d.ts';
export function hasDraft(
attrs: Pick<
ConversationAttributesType,
'draft' | 'draftAttachments' | 'quotedMessageId'
>
): boolean {
return (
(attrs.draft != null && attrs.draft.length > 1) ||
(attrs.draftAttachments != null && attrs.draftAttachments.length > 1) ||
attrs.quotedMessageId != null
);
}