MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / loadLayout

Function loadLayout

frontend/builder/builder-workspace.tsx:31–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30 useEffect(() => {
31 const loadLayout = async () => {
32 if (!builderId) {
33 setLayout(DefaultLayoutPercentages);
34 setIsLoading(false);
35 return;
36 }
37
38 try {
39 const rtInfo = await RpcApi.GetRTInfoCommand(TabRpcClient, {
40 oref: `builder:${builderId}`,
41 });
42 if (rtInfo?.["builder:layout"]) {
43 setLayout(rtInfo["builder:layout"] as Record<string, number>);
44 } else {
45 setLayout(DefaultLayoutPercentages);
46 }
47 } catch (error) {
48 console.error("Failed to load builder layout:", error);
49 setLayout(DefaultLayoutPercentages);
50 } finally {
51 setIsLoading(false);
52 }
53 };
54
55 loadLayout();
56 }, [builderId]);

Callers 1

Calls 1

GetRTInfoCommandMethod · 0.65

Tested by

no test coverage detected