mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-18 23:16:59 +01:00
Some small fixes
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
import { createSyncStoragePersister } from '@tanstack/query-sync-storage-persister';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
||||
import { persistQueryClient } from '@tanstack/react-query-persist-client';
|
||||
import { MotionConfig } from 'framer-motion';
|
||||
import { Suspense } from 'react';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
@@ -16,26 +13,12 @@ const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
retry: false,
|
||||
cacheTime: 1000 * 60 * 60 * 24, // 24 hours
|
||||
refetchOnWindowFocus: true,
|
||||
networkMode: 'offlineFirst',
|
||||
|
||||
// It's a desktop app, so this isn't necessary
|
||||
refetchOnWindowFocus: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const localStoragePersister = createSyncStoragePersister({
|
||||
storage: window.localStorage,
|
||||
throttleTime: 1000, // 1 second
|
||||
});
|
||||
|
||||
persistQueryClient({
|
||||
queryClient,
|
||||
persister: localStoragePersister,
|
||||
maxAge: 1000 * 60 * 60 * 24, // 24 hours
|
||||
});
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
@@ -46,7 +29,7 @@ export function App() {
|
||||
<Suspense>
|
||||
<AppRouter />
|
||||
<TauriListeners />
|
||||
<ReactQueryDevtools initialIsOpen={false} />
|
||||
{/*<ReactQueryDevtools initialIsOpen={false} />*/}
|
||||
</Suspense>
|
||||
</DialogProvider>
|
||||
</DndProvider>
|
||||
|
||||
@@ -46,7 +46,6 @@ const _Button = forwardRef<any, ButtonProps>(function Button(
|
||||
() =>
|
||||
classnames(
|
||||
className,
|
||||
'opacity-90 hover:opacity-100',
|
||||
'outline-none whitespace-nowrap',
|
||||
'focus-visible-or-class:ring',
|
||||
'rounded-md flex items-center',
|
||||
|
||||
@@ -15,7 +15,7 @@ export function StatusTag({ asBackground, response, className }: Props) {
|
||||
<span
|
||||
className={classnames(
|
||||
className,
|
||||
'text-white bg-opacity-90 dark:bg-opacity-50',
|
||||
'text-white bg-opacity-90 dark:bg-opacity-40',
|
||||
status >= 0 && status < 100 && 'bg-red-600',
|
||||
status >= 100 && status < 200 && 'bg-yellow-600',
|
||||
status >= 200 && status < 300 && 'bg-green-600',
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { useEffect } from 'react';
|
||||
import { getKeyValue } from '../lib/keyValueStore';
|
||||
import type { Appearance } from '../lib/theme/window';
|
||||
import {
|
||||
getAppearance,
|
||||
getPreferredAppearance,
|
||||
setAppearance,
|
||||
subscribeToPreferredAppearanceChange,
|
||||
} from '../lib/theme/window';
|
||||
@@ -26,14 +24,7 @@ export function useTheme() {
|
||||
useEffect(() => setAppearance(appearanceKv.value), [appearanceKv.value]);
|
||||
|
||||
return {
|
||||
appearance: appearanceKv.value ?? getAppearance(),
|
||||
appearance: appearanceKv.value,
|
||||
toggleAppearance: handleToggleAppearance,
|
||||
};
|
||||
}
|
||||
|
||||
export async function getAppearanceKv() {
|
||||
return getKeyValue<Appearance>({
|
||||
key: 'appearance',
|
||||
fallback: getPreferredAppearance(),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user