Skip to content

Commit 25721d5

Browse files
committed
Draft: Fix clearDraft (#6094)
1 parent 4713c63 commit 25721d5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/global/actions/api/messages.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,11 @@ addActionHandler('clearDraft', (global, actions, payload): ActionReturnType => {
684684

685685
const currentReplyInfo = currentDraft.replyInfo;
686686

687-
const newDraft: ApiDraft | undefined = (shouldKeepReply || shouldKeepSuggestedPost) ? {
688-
replyInfo: shouldKeepReply ? currentReplyInfo : undefined,
689-
suggestedPostInfo: shouldKeepSuggestedPost ? currentDraft.suggestedPostInfo : undefined,
690-
} : undefined;
687+
const newDraft: ApiDraft | undefined = (shouldKeepReply && currentReplyInfo)
688+
|| (shouldKeepSuggestedPost && currentDraft.suggestedPostInfo) ? {
689+
replyInfo: shouldKeepReply ? currentReplyInfo : undefined,
690+
suggestedPostInfo: shouldKeepSuggestedPost ? currentDraft.suggestedPostInfo : undefined,
691+
} : undefined;
691692

692693
saveDraft({
693694
global, chatId, threadId, draft: newDraft, isLocalOnly,

0 commit comments

Comments
 (0)