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,7 +684,8 @@ 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)
|| (shouldKeepSuggestedPost && currentDraft.suggestedPostInfo) ? {
replyInfo: shouldKeepReply ? currentReplyInfo : undefined, replyInfo: shouldKeepReply ? currentReplyInfo : undefined,
suggestedPostInfo: shouldKeepSuggestedPost ? currentDraft.suggestedPostInfo : undefined, suggestedPostInfo: shouldKeepSuggestedPost ? currentDraft.suggestedPostInfo : undefined,
} : undefined; } : undefined;