mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-17 23:34:14 +01:00
Add confirm dialog before discarding draft on edit
This commit is contained in:
@@ -3,10 +3,15 @@
|
||||
|
||||
import type { ConversationAttributesType } from '../model-types.d.ts';
|
||||
|
||||
export function hasDraft(attributes: ConversationAttributesType): boolean {
|
||||
const draftAttachments = attributes.draftAttachments || [];
|
||||
|
||||
return (attributes.draft ||
|
||||
attributes.quotedMessageId ||
|
||||
draftAttachments.length > 0) as boolean;
|
||||
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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user