@@ -19,7 +19,6 @@ import Animated, {
1919import {
2020 FileReference ,
2121 isLocalImageAttachment ,
22- MessageComposerConfig ,
2322 type MessageComposerState ,
2423 type TextComposerState ,
2524 type UserResponse ,
@@ -165,10 +164,6 @@ const messageComposerStateStoreSelector = (state: MessageComposerState) => ({
165164 quotedMessage : state . quotedMessage ,
166165} ) ;
167166
168- const configStateSelector = ( state : MessageComposerConfig ) => ( {
169- draftsEnabled : state . drafts . enabled ,
170- } ) ;
171-
172167const MessageInputWithContext = ( props : MessageInputPropsWithContext ) => {
173168 const {
174169 additionalTextInputProps,
@@ -224,7 +219,6 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
224219 const { quotedMessage } = useStateStore ( messageComposer . state , messageComposerStateStoreSelector ) ;
225220 const { attachments } = useAttachmentManagerState ( ) ;
226221 const hasSendableData = useMessageComposerHasSendableData ( ) ;
227- const { draftsEnabled } = useStateStore ( messageComposer . configState , configStateSelector ) ;
228222
229223 const imageUploads = attachments . filter ( ( attachment ) => isLocalImageAttachment ( attachment ) ) ;
230224 const fileUploads = attachments . filter ( ( attachment ) => ! isLocalImageAttachment ( attachment ) ) ;
@@ -265,7 +259,6 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
265259 const { seconds : cooldownRemainingSeconds } = useCountdown ( cooldownEndsAt ) ;
266260
267261 useEffect ( ( ) => {
268- messageComposer . updateConfig ( { drafts : { enabled : true } } ) ;
269262 attachmentManager . maxNumberOfFilesPerMessage = maxNumberOfFiles ;
270263 if ( doFileUploadRequest ) {
271264 attachmentManager . setCustomUploadFn ( doFileUploadRequest ) ;
@@ -316,13 +309,12 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
316309 } , [ messageComposer , inputBoxRef ] ) ;
317310
318311 // Effect to create draft whenever we un-mount the component.
319- useEffect ( ( ) => {
320- return ( ) => {
321- if ( draftsEnabled ) {
322- messageComposer . createDraft ( ) ;
323- }
324- } ;
325- } , [ draftsEnabled , messageComposer ] ) ;
312+ useEffect (
313+ ( ) => ( ) => {
314+ messageComposer . createDraft ( ) ;
315+ } ,
316+ [ messageComposer ] ,
317+ ) ;
326318
327319 const uploadImagesHandler = async ( ) => {
328320 const imageToUpload = selectedImages . find ( ( selectedImage ) => {
0 commit comments