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.

709 B
Raw Blame
import { AppState } from 'react-native'

// `executionHost` is the route's server; absent for the desktop's own workspaces.
let viewing: { hostId: string; worktreeId: string; executionHost?: string } | null = null
export function setNotificationViewingWorkspace(value: typeof viewing): void {
  viewing = value
}

export function shouldSuppressNotificationWhileViewing(
  event: { worktreeId?: string; executionHost?: string },
  hostId: string,
  suppressWhileViewing: boolean
): boolean {
  return (
    suppressWhileViewing &&
    AppState.currentState === 'active' &&
    viewing?.hostId === hostId &&
    viewing.worktreeId === event.worktreeId &&
    viewing.executionHost === event.executionHost
  )
}