()
| 157 | if (!isOpen) return; |
| 158 | |
| 159 | const fetchApps = async () => { |
| 160 | setLoading(true); |
| 161 | try { |
| 162 | const allApps = await env.rpc.ListAllAppsCommand(TabRpcClient); |
| 163 | const localApps = allApps |
| 164 | .filter((app) => !app.appid.startsWith("draft/")) |
| 165 | .sort((a, b) => { |
| 166 | const aName = a.appid.replace(/^local\//, ""); |
| 167 | const bName = b.appid.replace(/^local\//, ""); |
| 168 | return aName.localeCompare(bName); |
| 169 | }); |
| 170 | setApps(localApps); |
| 171 | } catch (error) { |
| 172 | console.error("Failed to fetch apps:", error); |
| 173 | setApps([]); |
| 174 | } finally { |
| 175 | setLoading(false); |
| 176 | } |
| 177 | }; |
| 178 | |
| 179 | fetchApps(); |
| 180 | }, [isOpen]); |
no test coverage detected