MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / loadChromeProfile

Function loadChromeProfile

packages/client/src/app/AppShell.tsx:1641–1671  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1639 let cancelled = false;
1640
1641 async function loadChromeProfile() {
1642 if (!selectedSimulator || !selectedSupportsChrome) {
1643 setChromeProfile(null);
1644 setChromeProfileReady(true);
1645 return;
1646 }
1647 const udid = selectedSimulator.udid;
1648 try {
1649 const profile = await fetchChromeProfile(udid);
1650 if (!isUsableChromeProfile(profile)) {
1651 throw new Error(
1652 "Device chrome profile did not include usable geometry.",
1653 );
1654 }
1655 if (!cancelled) {
1656 setChromeProfile(profile);
1657 setChromeProfileReady(true);
1658 }
1659 } catch {
1660 if (!cancelled) {
1661 setChromeProfile(null);
1662 setChromeProfileReady(true);
1663 setFailedChromeAssetUDIDs((current) => {
1664 if (current.has(udid)) {
1665 return current;
1666 }
1667 return new Set(current).add(udid);
1668 });
1669 }
1670 }
1671 }
1672
1673 void loadChromeProfile();
1674 return () => {

Callers 1

AppShellFunction · 0.85

Calls 2

fetchChromeProfileFunction · 0.90
isUsableChromeProfileFunction · 0.90

Tested by

no test coverage detected