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 { Outlet } from 'react-router-dom';
|
||||||
import { Helmet } from 'react-helmet';
|
import { Helmet } from 'react-helmet';
|
||||||
|
|
||||||
|
import { SWRConfig } from 'swr';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
userInfoStore,
|
userInfoStore,
|
||||||
siteInfoStore,
|
siteInfoStore,
|
||||||
|
@ -51,13 +53,18 @@ const Layout: FC = () => {
|
||||||
<meta name="description" content={siteInfo.description} />
|
<meta name="description" content={siteInfo.description} />
|
||||||
) : null}
|
) : null}
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<Header />
|
<SWRConfig
|
||||||
<AdminHeader />
|
value={{
|
||||||
<div className="position-relative page-wrap">
|
revalidateOnFocus: false,
|
||||||
<Outlet />
|
}}>
|
||||||
</div>
|
<Header />
|
||||||
<Toast msg={toastMsg} variant={variant} onClose={closeToast} />
|
<AdminHeader />
|
||||||
<Footer />
|
<div className="position-relative page-wrap">
|
||||||
|
<Outlet />
|
||||||
|
</div>
|
||||||
|
<Toast msg={toastMsg} variant={variant} onClose={closeToast} />
|
||||||
|
<Footer />
|
||||||
|
</SWRConfig>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,6 +46,8 @@ const Notifications = () => {
|
||||||
|
|
||||||
const handleTypeChange = (evt, val) => {
|
const handleTypeChange = (evt, val) => {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
setPage(1);
|
||||||
|
setNotificationData([]);
|
||||||
navigate(`/users/notifications/${val}`);
|
navigate(`/users/notifications/${val}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue