Moves conversation.getProps out of models
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
12
ts/util/hasDraft.ts
Normal file
12
ts/util/hasDraft.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
// 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;
|
||||
}
|
Reference in New Issue
Block a user