From 7ef55a27d379a886eed116c5cdfb6b0f4aa630a8 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 2 Feb 2024 23:27:07 +0500 Subject: [PATCH] fixed bug causing reply update to malfuction --- .../editor/container/editorContainer.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/screens/editor/container/editorContainer.tsx b/src/screens/editor/container/editorContainer.tsx index f87ae737a3..6302f80508 100644 --- a/src/screens/editor/container/editorContainer.tsx +++ b/src/screens/editor/container/editorContainer.tsx @@ -152,25 +152,27 @@ class EditorContainer extends Component { if (navigationParams.isReply) { ({ isReply } = navigationParams); + let _draftBody = ''; + if (post) { draftId = `${currentAccount.name}/${post.author}/${post.permlink}`; - const _draft = draftsCollection && draftsCollection[draftId]; + if (_draft && !!_draft.body) { const _mediaUrls = navigationParams.replyMediaUrls; - const _dBody = + _draftBody = _mediaUrls.length > 0 ? `${_draft.body}\n\n ![](${_mediaUrls[0]})` : _draft.body; - - this.setState({ - draftPost: { - body: _dBody, - }, - isReply, - draftId, - autoFocusText: true, - }); } } + + this.setState({ + draftPost: { + body: _draftBody, + }, + isReply, + draftId, + autoFocusText: true, + }); } if (navigationParams.isEdit) {