Files
orca/src/main/github/pr-refresh-renderer-port.ts
Brennan Benson fd334f1e99 Show CI results in the chat that opened or pushed to a pull request (#39020)
Shows CI result lines in the chat that opened or pushed to a pull request. They're hidden in the terminal overlay and on the phone until the phone app gets the setting.
2026-11-07 16:34:21 -08:00

23 lines
734 B
TypeScript

/** The desktop renderers PR refresh serves. A Node host (orcad) has none: no window reports
* visible PRs there, and refresh events go nowhere. Electron installs its own at startup. */
export type PRRefreshRendererPort = {
/** Whether the renderer that reported visible PRs is still open. */
isRendererOpen(webContentsId: number): boolean
sendToTrustedUI(channel: string, payload: unknown): void
}
const headless: PRRefreshRendererPort = {
isRendererOpen: () => false,
sendToTrustedUI: () => {}
}
let current = headless
export function setPRRefreshRendererPort(port: PRRefreshRendererPort | null): void {
current = port ?? headless
}
export function prRefreshRenderers(): PRRefreshRendererPort {
return current
}