#4967 Fixed issue of post not getting updated after edit, if the post was focused. (#5149)

Этот коммит содержится в:
Debanshu Kundu
2017-01-25 17:48:35 +05:30
коммит произвёл Joram Wilander
родитель 88ce5d363c
Коммит 7bcea832cd
2 изменённых файлов: 21 добавлений и 10 удалений

Просмотреть файл

@@ -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();
}
});
}
}