ui/client/features/project-gate/hooks/useProjectGate
Cockpit client (features), next. Source: ui/client/features/project-gate/hooks/useProjectGate.tsx.
Functions#
useProjectGate()#
useProjectGate():
object
Defined in: ui/client/features/project-gate/hooks/useProjectGate.tsx:23
Fetches project status once on mount and exposes the init-here and open-a-project actions — every gated route (Dashboard, Wizard, Pages Editor) mounts its own ProjectGateController, so each fetches independently rather than sharing one app-wide store; simpler than a cross-route context provider, and functionally equivalent since each gated screen only ever needs its own up-to-date status.
Returns#
error
error:
string|null
handleInit
handleInit: () =>
Promise<void>
Returns
Promise<void>
handleOpen
handleOpen: (
dir) =>Promise<void>
Parameters
dir
string
Returns
Promise<void>
initializing
initializing:
boolean
loadError
loadError:
string|null
openError
openError:
string|null
opening
opening:
boolean
: opening a folder as the project (the "Open a project" screen).
refresh
refresh: () =>
void
Returns
void
status
status:
ProjectStatus|null