Skip to content

Commit

Permalink
Merge pull request #2823 from ecency/nt/reply-update-fix
Browse files Browse the repository at this point in the history
fixed bug causing reply update to malfuction
  • Loading branch information
feruzm authored Feb 3, 2024
2 parents 917e592 + 7ef55a2 commit 881dcbc
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/screens/editor/container/editorContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,25 +152,27 @@ class EditorContainer extends Component<EditorContainerProps, any> {

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) {
Expand Down

0 comments on commit 881dcbc

Please sign in to comment.