mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-18 06:57:11 +01:00
Fix tauri listeners causing too many updates
This commit is contained in:
@@ -8,6 +8,7 @@ import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
import { HelmetProvider } from 'react-helmet-async';
|
||||
import { AppRouter } from './AppRouter';
|
||||
import { DialogProvider } from './DialogContext';
|
||||
import { TauriListeners } from './TauriListeners';
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
@@ -41,6 +42,7 @@ export function App() {
|
||||
<DialogProvider>
|
||||
<Suspense>
|
||||
<AppRouter />
|
||||
<TauriListeners />
|
||||
{/*<ReactQueryDevtools initialIsOpen={false} />*/}
|
||||
</Suspense>
|
||||
</DialogProvider>
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
useLocation,
|
||||
} from 'react-router-dom';
|
||||
import { routePaths } from '../hooks/useRoutes';
|
||||
import { useTauriListeners } from '../hooks/useTauriListeners';
|
||||
import { setLastLocation } from '../lib/lastLocation';
|
||||
import RouteError from './RouteError';
|
||||
import Workspace from './Workspace';
|
||||
@@ -43,7 +42,6 @@ const router = createBrowserRouter([
|
||||
]);
|
||||
|
||||
export function AppRouter() {
|
||||
useTauriListeners();
|
||||
return <RouterProvider router={router} />;
|
||||
}
|
||||
|
||||
|
||||
6
src-web/components/TauriListeners.tsx
Normal file
6
src-web/components/TauriListeners.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import { useTauriListeners } from '../hooks/useTauriListeners';
|
||||
|
||||
export function TauriListeners() {
|
||||
useTauriListeners();
|
||||
return <></>;
|
||||
}
|
||||
Reference in New Issue
Block a user