Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

731 B
Raw Blame
import { getRepoExecutionHostId } from '../../../src/shared/execution-host'

type MobileNewWorkspaceDialogRepo = {
  id: string
  connectionId?: string | null
  executionHostId?: string | null
}

// Repo ids are unique per host, not globally.
export function isSameMobileWorkspaceRepo(
  a: MobileNewWorkspaceDialogRepo,
  b: MobileNewWorkspaceDialogRepo
): boolean {
  return a.id === b.id && getRepoExecutionHostId(a) === getRepoExecutionHostId(b)
}

export function refreshMobileNewWorkspaceDialogSelectedRepo<T extends MobileNewWorkspaceDialogRepo>(
  repos: readonly T[],
  current: T | null
): T | null {
  if (!current) {
    return null
  }
  return repos.find((repo) => isSameMobileWorkspaceRepo(repo, current)) ?? null
}