diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts index dca91eecd32..75c0378fb66 100644 --- a/ts/models/conversations.ts +++ b/ts/models/conversations.ts @@ -3944,11 +3944,13 @@ export class ConversationModel extends window.Backbone sendHQImages, storyId, timestamp, + extraReduxActions, }: { dontClearDraft?: boolean; sendHQImages?: boolean; storyId?: string; timestamp?: number; + extraReduxActions?: () => void; } = {} ): Promise { if (this.isGroupV1AndDisabled()) { @@ -4118,6 +4120,8 @@ export class ConversationModel extends window.Backbone if (enableProfileSharing) { this.captureChange('mandatoryProfileSharing'); } + + extraReduxActions?.(); } finally { this.isInReduxBatch = false; } diff --git a/ts/views/conversation_view.ts b/ts/views/conversation_view.ts index 927532db5da..df4f305f904 100644 --- a/ts/views/conversation_view.ts +++ b/ts/views/conversation_view.ts @@ -3,7 +3,6 @@ /* eslint-disable camelcase */ -import { batch as batchDispatch } from 'react-redux'; import { debounce, flatten, omit, throttle } from 'lodash'; import { render } from 'mustache'; @@ -2969,17 +2968,16 @@ export class ConversationView extends window.Backbone.View { { sendHQImages, timestamp, + extraReduxActions: () => { + this.compositionApi.current?.reset(); + model.setMarkedUnread(false); + this.setQuoteMessage(null); + this.resetLinkPreview(); + this.clearAttachments(); + window.reduxActions.composer.resetComposer(); + }, } ); - - batchDispatch(() => { - this.compositionApi.current?.reset(); - model.setMarkedUnread(false); - this.setQuoteMessage(null); - this.resetLinkPreview(); - this.clearAttachments(); - window.reduxActions.composer.resetComposer(); - }); } catch (error) { log.error( 'Error pulling attached files before send',