fix(web): Add ScrollRestoration
This commit is contained in:
1 file changed
+2
-2
+2
-2
@@ -8,6 +8,7 @@ import {
|
|||||||
Outlet,
|
Outlet,
|
||||||
Route,
|
Route,
|
||||||
Routes,
|
Routes,
|
||||||
|
ScrollRestoration,
|
||||||
useLocation,
|
useLocation,
|
||||||
useNavigate,
|
useNavigate,
|
||||||
} from "react-router-dom";
|
} from "react-router-dom";
|
||||||
@@ -250,8 +251,6 @@ function AppReady() {
|
|||||||
const isQueryFetching = useIsFetching();
|
const isQueryFetching = useIsFetching();
|
||||||
const isMutating = useIsMutating();
|
const isMutating = useIsMutating();
|
||||||
|
|
||||||
console.info(location.pathname + "----" + isQueryFetching);
|
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
async function checkForUpdates() {
|
async function checkForUpdates() {
|
||||||
try {
|
try {
|
||||||
@@ -289,6 +288,7 @@ function AppReady() {
|
|||||||
<SnackbarProvider maxSnack={5}>
|
<SnackbarProvider maxSnack={5}>
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<CssBaseline />
|
<CssBaseline />
|
||||||
|
<ScrollRestoration />
|
||||||
<NProgress
|
<NProgress
|
||||||
isAnimating={isQueryFetching}
|
isAnimating={isQueryFetching}
|
||||||
key={isQueryFetching || isMutating ? "fetching" : "notFetching"}
|
key={isQueryFetching || isMutating ? "fetching" : "notFetching"}
|
||||||
|
|||||||
Reference in new issue
Block a user