mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-03 07:03:18 +00:00
A workspace restored at launch with no open chat had nothing demanding its host's directory on a phone, so the deck waited on hydration that never started. The workspace route now keeps its host's directory demanded while mounted, through the same hook the agent route uses.
17 lines
659 B
TypeScript
17 lines
659 B
TypeScript
import { useEffect } from "react";
|
|
import { getHostRuntimeStore } from "@/runtime/host-runtime";
|
|
|
|
/**
|
|
* Keeps a host's directory demanded while the caller is mounted.
|
|
*
|
|
* The sidebar only demands the directory while its panel is active, so a compact app that
|
|
* restores straight into a workspace or agent route has nothing else asking the host for
|
|
* workspaces and agents. Without demand the route waits on hydration that never starts.
|
|
*/
|
|
export function useDirectoryDemand(serverId: string | null | undefined): void {
|
|
useEffect(() => {
|
|
if (!serverId) return;
|
|
return getHostRuntimeStore().acquireDirectoryDemand(serverId);
|
|
}, [serverId]);
|
|
}
|