signal-desktop/ts/util/hasDraft.ts
Josh Perez 7c1957c30d
Moves conversation.getProps out of models
Co-authored-by: Scott Nonnenberg <scott@signal.org>
2023-06-02 10:54:36 -07:00

12 lines
400 B
TypeScript

// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ConversationAttributesType } from '../model-types';
export function hasDraft(attributes: ConversationAttributesType): boolean {
const draftAttachments = attributes.draftAttachments || [];
return (attributes.draft ||
attributes.quotedMessageId ||
draftAttachments.length > 0) as boolean;
}