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.

708 B
Raw Blame
import type { FileDocState, MarkdownDocState, MobileSessionTab } from './mobile-session-route-types'

/** Retap of the open markdown or file tab is not a reload; refresh is a separate control. */
export function isCachedActiveDocumentRetap(
  tab: MobileSessionTab,
  activeSessionTabId: string | null,
  docs: {
    markdownDocs: ReadonlyMap<string, MarkdownDocState>
    fileDocs: ReadonlyMap<string, FileDocState>
  }
): boolean {
  if (tab.id !== activeSessionTabId || (tab.type !== 'markdown' && tab.type !== 'file')) {
    return false
  }
  const cached = tab.type === 'markdown' ? docs.markdownDocs.get(tab.id) : docs.fileDocs.get(tab.id)
  return cached !== undefined && cached.status !== 'error'
}