mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
fix: apply CodeRabbit auto-fixes
This commit is contained in:
1 parent
d99fcc268e
commit
df9200880e
15 files changed
+87
-89
No files matched your search
@@ -13,10 +13,6 @@ export interface SessionPickerRouteScope {
|
||||
remote: { serverId: string; serverName?: string; projectDirectory?: string } | undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves what a session picker opened on the current route should list: the Manager repo of a
|
||||
* repo route, or the selected linked server and its project directory.
|
||||
*/
|
||||
export function useSessionPickerRouteScope(enabled: boolean): SessionPickerRouteScope {
|
||||
const { pathname, search } = useLocation()
|
||||
const [selectedServerId] = useSidebarServerSelection()
|
||||
|
||||
@@ -6,16 +6,6 @@ export interface UseVcsInfoOptions {
|
||||
enabled?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the version-control info of a directory through the OpenCode server in
|
||||
* scope. The query is keyed by directory and server id, so the session header,
|
||||
* the project header and the source control panel share one cached read, and a
|
||||
* linked server reports its own checkout rather than the Manager's.
|
||||
*
|
||||
* @param directory Absolute checkout directory; the query stays disabled without one.
|
||||
* @param serverId Linked server to read from, or the local Manager when omitted.
|
||||
* @param options.enabled Whether to read the info; defaults to `true`.
|
||||
*/
|
||||
export function useVcsInfo(
|
||||
directory: string | undefined,
|
||||
serverId: string | undefined,
|
||||
@@ -28,6 +18,5 @@ export function useVcsInfo(
|
||||
queryFn: () => getVcsInfo(directory ?? '', serverId),
|
||||
enabled: enabled && Boolean(directory),
|
||||
retry: false,
|
||||
staleTime: 60_000,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user