Draft: Fix clearDraft (#6094)
This commit is contained in:
parent
4713c63fa4
commit
25721d514e
@ -684,10 +684,11 @@ addActionHandler('clearDraft', (global, actions, payload): ActionReturnType => {
|
||||
|
||||
const currentReplyInfo = currentDraft.replyInfo;
|
||||
|
||||
const newDraft: ApiDraft | undefined = (shouldKeepReply || shouldKeepSuggestedPost) ? {
|
||||
replyInfo: shouldKeepReply ? currentReplyInfo : undefined,
|
||||
suggestedPostInfo: shouldKeepSuggestedPost ? currentDraft.suggestedPostInfo : undefined,
|
||||
} : undefined;
|
||||
const newDraft: ApiDraft | undefined = (shouldKeepReply && currentReplyInfo)
|
||||
|| (shouldKeepSuggestedPost && currentDraft.suggestedPostInfo) ? {
|
||||
replyInfo: shouldKeepReply ? currentReplyInfo : undefined,
|
||||
suggestedPostInfo: shouldKeepSuggestedPost ? currentDraft.suggestedPostInfo : undefined,
|
||||
} : undefined;
|
||||
|
||||
saveDraft({
|
||||
global, chatId, threadId, draft: newDraft, isLocalOnly,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user