mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 03:15:01 +00:00
* 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
39 lines
1.2 KiB
TypeScript
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 }
|
|
}
|