MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / useWatchedSessionSync

Function useWatchedSessionSync

src/app/app-shell/useWindowShellSync.ts:14–31  ·  view source on GitHub ↗
(workspaceState: WorkspaceState)

Source from the content-addressed store, hash-verified

12}
13
14export function useWatchedSessionSync(workspaceState: WorkspaceState) {
15 useEffect(() => {
16 if (!window.piDesktop?.watchSession) {
17 return
18 }
19
20 const watchedSessionPath =
21 workspaceState.activeView === 'chat' ||
22 workspaceState.activeView === 'thread' ||
23 workspaceState.activeView === 'gitops'
24 ? getPersistedSessionPath(workspaceState.selectedSessionPath)
25 : null
26
27 void window.piDesktop.watchSession(watchedSessionPath).catch((error) => {
28 console.warn('Failed to update watched Pi session.', error)
29 })
30 }, [workspaceState.activeView, workspaceState.selectedSessionPath])
31}
32
33export function useUtilityViewEscape({
34 activeView,

Callers 1

useAppShellEffectsFunction · 0.90

Calls 1

getPersistedSessionPathFunction · 0.90

Tested by

no test coverage detected