mirror of https://gitee.com/answerdev/answer.git
fix: notification render error & remove SWR auto load on focus
This commit is contained in:
parent
2031b76ee5
commit
a95ef9a477
|
@ -3,6 +3,8 @@ import { useTranslation } from 'react-i18next';
|
|||
import { Outlet } from 'react-router-dom';
|
||||
import { Helmet } from 'react-helmet';
|
||||
|
||||
import { SWRConfig } from 'swr';
|
||||
|
||||
import {
|
||||
userInfoStore,
|
||||
siteInfoStore,
|
||||
|
@ -51,6 +53,10 @@ const Layout: FC = () => {
|
|||
<meta name="description" content={siteInfo.description} />
|
||||
) : null}
|
||||
</Helmet>
|
||||
<SWRConfig
|
||||
value={{
|
||||
revalidateOnFocus: false,
|
||||
}}>
|
||||
<Header />
|
||||
<AdminHeader />
|
||||
<div className="position-relative page-wrap">
|
||||
|
@ -58,6 +64,7 @@ const Layout: FC = () => {
|
|||
</div>
|
||||
<Toast msg={toastMsg} variant={variant} onClose={closeToast} />
|
||||
<Footer />
|
||||
</SWRConfig>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -46,6 +46,8 @@ const Notifications = () => {
|
|||
|
||||
const handleTypeChange = (evt, val) => {
|
||||
evt.preventDefault();
|
||||
setPage(1);
|
||||
setNotificationData([]);
|
||||
navigate(`/users/notifications/${val}`);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue