Files
orca/src/main/ipc/watched-worktree-catalog-notification.ts
T
mirror 34fa2cd5ca
Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
source snapshot 2026-09-02
2026-09-02 02:03:16 +08:00

34 lines
1.0 KiB
TypeScript

import type { BrowserWindow } from 'electron'
import type { OrcaRuntimeService } from '../runtime/orca-runtime'
import { notifyWorktreesChanged } from './worktree-remote'
type WorktreeCatalogRemoteClientNotifier = Pick<
OrcaRuntimeService,
'notifyWorktreeCatalogChangedForRemoteClients'
>
let remoteClientNotifier: WorktreeCatalogRemoteClientNotifier | null = null
export function setWorktreeCatalogRemoteClientNotifier(
notifier: WorktreeCatalogRemoteClientNotifier | null
): void {
remoteClientNotifier = notifier
}
export function notifyWatchedWorktreeCatalogChanged(
mainWindow: BrowserWindow,
repoId: string,
connectionId?: string
): void {
notifyWorktreesChanged(mainWindow, repoId)
if (connectionId) {
return
}
try {
remoteClientNotifier?.notifyWorktreeCatalogChangedForRemoteClients(repoId)
} catch (error) {
// Why: remote fanout must not block the host renderer's watcher refresh.
console.error('[worktrees] failed to notify remote clients of watched catalog change', error)
}
}