Draft: Fix clearDraft (#6094)

This commit is contained in:
Alexander Zinchuk 2025-07-31 00:53:19 +02:00
parent 4713c63fa4
commit 25721d514e

View File

@ -684,10 +684,11 @@ addActionHandler('clearDraft', (global, actions, payload): ActionReturnType => {
const currentReplyInfo = currentDraft.replyInfo; const currentReplyInfo = currentDraft.replyInfo;
const newDraft: ApiDraft | undefined = (shouldKeepReply || shouldKeepSuggestedPost) ? { const newDraft: ApiDraft | undefined = (shouldKeepReply && currentReplyInfo)
replyInfo: shouldKeepReply ? currentReplyInfo : undefined, || (shouldKeepSuggestedPost && currentDraft.suggestedPostInfo) ? {
suggestedPostInfo: shouldKeepSuggestedPost ? currentDraft.suggestedPostInfo : undefined, replyInfo: shouldKeepReply ? currentReplyInfo : undefined,
} : undefined; suggestedPostInfo: shouldKeepSuggestedPost ? currentDraft.suggestedPostInfo : undefined,
} : undefined;
saveDraft({ saveDraft({
global, chatId, threadId, draft: newDraft, isLocalOnly, global, chatId, threadId, draft: newDraft, isLocalOnly,