rev
This commit is contained in:
1 parent
e1ba603605
commit
ee2f6bd742
3 files changed
+10
-11
No files matched your search
@@ -30,7 +30,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useDebouncedValue } from "@tanstack/react-pacer/debouncer";
|
||||
import { gitBranchesQueryOptions, gitCreateWorktreeMutationOptions } from "~/lib/gitReactQuery";
|
||||
import { projectSearchEntriesQueryOptions } from "~/lib/projectReactQuery";
|
||||
import { serverKeybindingsQueryOptions } from "~/lib/serverReactQuery";
|
||||
import { serverConfigQueryOptions } from "~/lib/serverReactQuery";
|
||||
|
||||
import { isElectron } from "../env";
|
||||
import { buildBootstrapInput } from "../historyBootstrap";
|
||||
@@ -471,7 +471,10 @@ export default function ChatView() {
|
||||
);
|
||||
const effectivePathQuery = pathTriggerQuery.length > 0 ? debouncedPathQuery : "";
|
||||
const branchesQuery = useQuery(gitBranchesQueryOptions(api, gitCwd));
|
||||
const keybindingsQuery = useQuery(serverKeybindingsQueryOptions(api));
|
||||
const keybindingsQuery = useQuery({
|
||||
...serverConfigQueryOptions(api),
|
||||
select: (config) => config.keybindings,
|
||||
});
|
||||
const workspaceEntriesQuery = useQuery(
|
||||
projectSearchEntriesQueryOptions({
|
||||
api,
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from "../types";
|
||||
import { useNativeApi } from "../hooks/useNativeApi";
|
||||
import { gitRemoveWorktreeMutationOptions } from "../lib/gitReactQuery";
|
||||
import { serverKeybindingsQueryOptions } from "../lib/serverReactQuery";
|
||||
import { serverConfigQueryOptions } from "../lib/serverReactQuery";
|
||||
import { toastManager } from "./ui/toast";
|
||||
import { formatWorktreePathForDisplay, getOrphanedWorktreePathForThread } from "../worktreeCleanup";
|
||||
|
||||
@@ -118,7 +118,10 @@ function terminalStatusIndicator(thread: Thread): TerminalStatusIndicator | null
|
||||
export default function Sidebar() {
|
||||
const { state, dispatch } = useStore();
|
||||
const api = useNativeApi();
|
||||
const { data: keybindings = EMPTY_KEYBINDINGS } = useQuery(serverKeybindingsQueryOptions(api));
|
||||
const { data: keybindings = EMPTY_KEYBINDINGS } = useQuery({
|
||||
...serverConfigQueryOptions(api),
|
||||
select: (config) => config.keybindings,
|
||||
});
|
||||
const queryClient = useQueryClient();
|
||||
const removeWorktreeMutation = useMutation(
|
||||
gitRemoveWorktreeMutationOptions({ api, queryClient }),
|
||||
|
||||
@@ -19,10 +19,3 @@ export function serverConfigQueryOptions(api: NativeApi | undefined) {
|
||||
staleTime: Infinity,
|
||||
});
|
||||
}
|
||||
|
||||
export function serverKeybindingsQueryOptions(api: NativeApi | undefined) {
|
||||
return queryOptions({
|
||||
...serverConfigQueryOptions(api),
|
||||
select: (config) => config.keybindings,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user