()
| 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]); |
no test coverage detected