mirror of https://gitee.com/answerdev/answer.git
fix(scroll): Set scroll position for Question detail
This commit is contained in:
parent
5617a4eb0e
commit
a4f69d24d5
|
@ -41,10 +41,10 @@ const Index: FC<IProps> = ({
|
|||
const navigate = useNavigate();
|
||||
const reportModal = useReportModal();
|
||||
|
||||
const refershQuestion = () => {
|
||||
const refreshQuestion = () => {
|
||||
callback?.('default');
|
||||
};
|
||||
const closeModal = useReportModal(refershQuestion);
|
||||
const closeModal = useReportModal(refreshQuestion);
|
||||
const editUrl =
|
||||
type === 'answer' ? `/posts/${qid}/${aid}/edit` : `/posts/${qid}/edit`;
|
||||
|
||||
|
@ -132,7 +132,7 @@ const Index: FC<IProps> = ({
|
|||
msg: t('success', { keyPrefix: 'question_detail.reopen' }),
|
||||
variant: 'success',
|
||||
});
|
||||
refershQuestion();
|
||||
refreshQuestion();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -123,7 +123,6 @@ const Index = () => {
|
|||
}, 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
if (type === 'default') {
|
||||
window.scrollTo(0, 0);
|
||||
getDetail();
|
||||
|
@ -150,6 +149,7 @@ const Index = () => {
|
|||
if (!qid) {
|
||||
return;
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
getDetail();
|
||||
requestAnswers();
|
||||
}, [qid]);
|
||||
|
|
Loading…
Reference in New Issue