ui/client/features/git-session/hooks/useGitSession
Cockpit client (features), v0.8. Source: ui/client/features/git-session/hooks/useGitSession.tsx.
Variables#
POLL_MS#
constPOLL_MS:1500=1500
Defined in: ui/client/features/git-session/hooks/useGitSession.tsx:11
How often the Cockpit re-reads the session. The coalescing window closes on the SERVER's timer, so without a poll the indicator would go stale at exactly the moment a commit happens.
Functions#
useGitSession()#
useGitSession():
object
Defined in: ui/client/features/git-session/hooks/useGitSession.tsx:32
The commit-on-save session: current config, the branch, what is pending, and the one question this feature may ask (a dirty tree at session start). Polls rather than being told, because commits also happen on a timer, with no request in flight to attach a response to.
Returns#
object
answer
answer: (
choice,remember) =>Promise<void>
Parameters
choice
remember
boolean
Returns
Promise<void>
busy
busy:
boolean=state.busy
commit
commit: () =>
Promise<void>
Returns
Promise<void>
error
error:
string|null=state.error
refresh
refresh: () =>
Promise<void>
Returns
Promise<void>
status
status:
GitSessionStatus|null=state.status
updateConfig
updateConfig: (
patch) =>Promise<void>
Parameters
patch
Partial<CommitConfig>
Returns
Promise<void>