Files
orca/mobile/src/source-control/use-mobile-source-control-commit-failure.ts
T
Neil 19043a3d76 refactor(mobile): organize pairing, session, RPC and host owners (#39846)
* refactor(mobile): give relay and encryption concrete owners

* refactor(mobile): organize session and review feature owners

* refactor(mobile): organize RPC and host ownership

* test(mobile): point render fixtures at concrete owners

* refactor(mobile): use explicit type-only owner imports
2026-11-08 07:19:05 -08:00

39 lines
1.2 KiB
TypeScript

import { useState } from 'react'
import type { ConnectionState } from '../transport/connection/connection-state'
import type { RpcClient } from '../transport/rpc/rpc-client-contract'
import type {
MobileCommitFailureRecovery,
RecordMobileCommitFailure
} from './mobile-commit-failure-recovery'
import { useMobileCommitFailureRecovery } from './use-mobile-commit-failure-recovery'
type Params = {
client: RpcClient | null
connState: ConnectionState
worktreeId: string
worktreeLabel: string | null
}
export function useMobileSourceControlCommitFailure({
client,
connState,
worktreeId,
worktreeLabel
}: Params): {
commitFailureRecovery: MobileCommitFailureRecovery | null
commitFailureRecoveryAction: ReturnType<typeof useMobileCommitFailureRecovery>
recordCommitFailure: RecordMobileCommitFailure
} {
const [commitFailureRecovery, recordCommitFailure] = useState<MobileCommitFailureRecovery | null>(
null
)
const commitFailureRecoveryAction = useMobileCommitFailureRecovery({
client,
connState,
worktreeId,
workspaceLabel: worktreeLabel,
failure: commitFailureRecovery
})
return { commitFailureRecovery, commitFailureRecoveryAction, recordCommitFailure }
}