fix(router): Remove ScrollRestoration and improve episodeSkeleton

This commit is contained in:
Prayag Prajapati committed 2024-02-20 11:53:45 +05:30
1 parent 81a2135254
commit ea2e0a6b1c
5 files changed
+14 -5

No files matched your search

+2 -4
View File
@@ -5,10 +5,8 @@ import { AnimatePresence, motion } from "framer-motion";
import { SnackbarProvider } from "notistack";
import {
Navigate,
Outlet,
Route,
Routes,
ScrollRestoration,
useLocation,
useNavigate,
} from "react-router-dom";
@@ -224,7 +222,6 @@ function App() {
return <AppReady />;
}
function AppReady() {
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
const { enqueueSnackbar } = useSnackbar();
@@ -251,6 +248,8 @@ function AppReady() {
const isQueryFetching = useIsFetching();
const isMutating = useIsMutating();
useEffect(() => window.scrollTo(0, 0), [location.key]);
useLayoutEffect(() => {
async function checkForUpdates() {
try {
@@ -288,7 +287,6 @@ function AppReady() {
<SnackbarProvider maxSnack={5}>
<ThemeProvider theme={theme}>
<CssBaseline />
<ScrollRestoration />
<NProgress
isAnimating={isQueryFetching}
key={isQueryFetching || isMutating ? "fetching" : "notFetching"}