diff options
author | Debanshu Kundu <debanshu.kundu@joshtechnologygroup.com> | 2017-01-25 17:48:35 +0530 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-01-25 07:18:35 -0500 |
commit | 7bcea832cdd2391369c66a831d43036ebd82bdea (patch) | |
tree | cdde490b58a4189cbd8aa5f623c1efad2199297a /webapp/components/edit_post_modal.jsx | |
parent | 88ce5d363c7fd9e77dc8e4d36c0616ad006a7e48 (diff) | |
download | chat-7bcea832cdd2391369c66a831d43036ebd82bdea.tar.gz chat-7bcea832cdd2391369c66a831d43036ebd82bdea.tar.bz2 chat-7bcea832cdd2391369c66a831d43036ebd82bdea.zip |
#4967 Fixed issue of post not getting updated after edit, if the post was focused. (#5149)
Diffstat (limited to 'webapp/components/edit_post_modal.jsx')
-rw-r--r-- | webapp/components/edit_post_modal.jsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/webapp/components/edit_post_modal.jsx b/webapp/components/edit_post_modal.jsx index 7c1747ef7..b2b607428 100644 --- a/webapp/components/edit_post_modal.jsx +++ b/webapp/components/edit_post_modal.jsx @@ -93,7 +93,9 @@ export default class EditPostModal extends React.Component { updatedPost, () => { window.scrollTo(0, 0); - }); + }, + Boolean(PostStore.getFocusedPostId()) // If there is focused post we need to update that post's store too. + ); $('#edit_post').modal('hide'); } @@ -184,7 +186,10 @@ export default class EditPostModal extends React.Component { onModalHide() { if (this.state.refocusId !== '') { setTimeout(() => { - $(this.state.refocusId).get(0).focus(); + const element = $(this.state.refocusId).get(0); + if (element) { + element.focus(); + } }); } } |