mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-19 07:53:54 +01:00
Move request-related settings to workspace
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import type {OsType} from '@tauri-apps/api/os';
|
||||
import {useEffect, useRef} from 'react';
|
||||
import {capitalize} from '../lib/capitalize';
|
||||
import {debounce} from '../lib/debounce';
|
||||
import {useOsInfo} from './useOsInfo';
|
||||
import type { OsType } from '@tauri-apps/api/os';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { capitalize } from '../lib/capitalize';
|
||||
import { debounce } from '../lib/debounce';
|
||||
import { useOsInfo } from './useOsInfo';
|
||||
|
||||
export type HotkeyAction =
|
||||
| 'request.send'
|
||||
@@ -87,8 +87,6 @@ export function useAnyHotkey(
|
||||
|
||||
currentKeys.current.add(normalizeKey(e.key, os));
|
||||
|
||||
console.log("HOTKEY", e.key);
|
||||
|
||||
for (const [hkAction, hkKeys] of Object.entries(hotkeys) as [HotkeyAction, string[]][]) {
|
||||
for (const hkKey of hkKeys) {
|
||||
const keys = hkKey.split('+');
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '../lib/theme/window';
|
||||
import { useSettings } from './useSettings';
|
||||
|
||||
export function useTheme() {
|
||||
export function useSyncAppearance() {
|
||||
const [preferredAppearance, setPreferredAppearance] = useState<Appearance>(
|
||||
getPreferredAppearance(),
|
||||
);
|
||||
@@ -21,6 +21,7 @@ export function useUpdateWorkspace(id: string | null) {
|
||||
if (workspace === null) return;
|
||||
|
||||
const newWorkspace = typeof v === 'function' ? v(workspace) : { ...workspace, ...v };
|
||||
console.log('NEW WORKSPACE', newWorkspace);
|
||||
queryClient.setQueryData<Workspace[]>(workspacesQueryKey(workspace), (workspaces) =>
|
||||
(workspaces ?? []).map((w) => (w.id === newWorkspace.id ? newWorkspace : w)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user