mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-24 10:21:15 +01:00
Fixed key/value stuff
This commit is contained in:
@@ -13,12 +13,10 @@ import { keyValueQueryKey } from '../hooks/useKeyValue';
|
||||
import { requestsQueryKey } from '../hooks/useRequests';
|
||||
import { responsesQueryKey } from '../hooks/useResponses';
|
||||
import { routePaths } from '../hooks/useRoutes';
|
||||
import type { SidebarDisplay } from '../hooks/useSidebarDisplay';
|
||||
import { sidebarDisplayDefaultValue, sidebarDisplayKey } from '../hooks/useSidebarDisplay';
|
||||
import { workspacesQueryKey } from '../hooks/useWorkspaces';
|
||||
import { DEFAULT_FONT_SIZE } from '../lib/constants';
|
||||
import { debounce } from '../lib/debounce';
|
||||
import { extractKeyValue, getKeyValue, setKeyValue } from '../lib/keyValueStore';
|
||||
import { extractKeyValue } from '../lib/keyValueStore';
|
||||
import type { HttpRequest, HttpResponse, KeyValue, Workspace } from '../lib/models';
|
||||
import { AppRouter } from './AppRouter';
|
||||
import { DialogProvider } from './DialogContext';
|
||||
@@ -161,17 +159,6 @@ await listen('refresh', () => {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
await listen('toggle_sidebar', async () => {
|
||||
const display = await getKeyValue<SidebarDisplay>({
|
||||
key: sidebarDisplayKey,
|
||||
fallback: sidebarDisplayDefaultValue,
|
||||
});
|
||||
await setKeyValue({
|
||||
key: sidebarDisplayKey,
|
||||
value: { width: display.width, hidden: !display.hidden },
|
||||
});
|
||||
});
|
||||
|
||||
await listen('zoom', ({ payload: zoomDelta }: { payload: number }) => {
|
||||
const fontSize = parseFloat(window.getComputedStyle(document.documentElement).fontSize);
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Suspense } from 'react';
|
||||
import { createBrowserRouter, Navigate, RouterProvider } from 'react-router-dom';
|
||||
import { routePaths } from '../hooks/useRoutes';
|
||||
import Workspace from './Workspace';
|
||||
import { useTauriListeners } from '../hooks/useTauriListeners';
|
||||
import RouteError from './RouteError';
|
||||
import Workspace from './Workspace';
|
||||
import Workspaces from './Workspaces';
|
||||
|
||||
const router = createBrowserRouter([
|
||||
@@ -34,6 +35,7 @@ const router = createBrowserRouter([
|
||||
]);
|
||||
|
||||
export function AppRouter() {
|
||||
useTauriListeners();
|
||||
return (
|
||||
<Suspense>
|
||||
<RouterProvider router={router} />
|
||||
|
||||
Reference in New Issue
Block a user