fixes, improvmeents
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { AuthProvider } from "@/contexts/auth-context"
|
||||
import { SpotifyProvider } from "@/contexts/spotify-context"
|
||||
import MantineProvider from "@/lib/mantine/mantine-provider"
|
||||
import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools'
|
||||
import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'
|
||||
import { TanStackDevtools } from '@tanstack/react-devtools'
|
||||
import { Toaster } from "sonner"
|
||||
|
||||
const Providers = ({ children }: { children: React.ReactNode }) => {
|
||||
@@ -8,6 +11,22 @@ const Providers = ({ children }: { children: React.ReactNode }) => {
|
||||
<AuthProvider>
|
||||
<SpotifyProvider>
|
||||
<MantineProvider>
|
||||
<TanStackDevtools
|
||||
eventBusConfig={{
|
||||
debug: false,
|
||||
connectToServerBus: true,
|
||||
}}
|
||||
plugins={[
|
||||
{
|
||||
name: 'TanStack Query',
|
||||
render: <ReactQueryDevtoolsPanel />,
|
||||
},
|
||||
{
|
||||
name: 'TanStack Router',
|
||||
render: <TanStackRouterDevtoolsPanel />,
|
||||
}
|
||||
]}
|
||||
/>
|
||||
<Toaster position='top-center' />
|
||||
{children}
|
||||
</MantineProvider>
|
||||
|
||||
@@ -32,7 +32,10 @@ const Pullable: React.FC<PullableProps> = ({ children, scrollPosition, onScrollP
|
||||
if (refresh.length > 0) {
|
||||
// TODO: Remove this after testing - or does the delay help ux?
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await queryClient.refetchQueries({ queryKey: refresh, exact: true});
|
||||
refresh.forEach(async (queryKey) => {
|
||||
const keyArray = Array.isArray(queryKey) ? queryKey : [queryKey];
|
||||
await queryClient.refetchQueries({ queryKey: keyArray, exact: true });
|
||||
});
|
||||
}
|
||||
setIsRefreshing(false);
|
||||
}, [refresh]);
|
||||
|
||||
Reference in New Issue
Block a user