@calimero-network/mero-react 9.11.0 → 9.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1599,26 +1599,29 @@ function MeroProvider({
1599
1599
  setIsLoading(false);
1600
1600
  if (!nodeKey) return;
1601
1601
  }
1602
+ if (packageName) {
1603
+ try {
1604
+ const { applicationId: derived } = await resolveApplicationIdFromRegistry(
1605
+ registryUrl ?? DEFAULT_REGISTRY_URL,
1606
+ packageName
1607
+ );
1608
+ if (!active) return;
1609
+ setApplicationIdState(derived);
1610
+ return;
1611
+ } catch (e) {
1612
+ console.warn(`[mero-react] could not learn the application id of ${packageName} from the registry`, e);
1613
+ if (!active) return;
1614
+ }
1615
+ }
1602
1616
  try {
1603
1617
  const contexts = await listDelegatedContexts(delegated);
1618
+ if (!active) return;
1604
1619
  const apps = [
1605
1620
  ...new Set((contexts ?? []).map((c) => c.applicationId).filter(Boolean))
1606
1621
  ];
1607
- if (!active) return;
1608
1622
  if (apps.length === 1) {
1609
1623
  setApplicationIdState(apps[0]);
1610
1624
  }
1611
- if (apps.length === 0 && packageName) {
1612
- try {
1613
- const { applicationId: derived } = await resolveApplicationIdFromRegistry(
1614
- registryUrl ?? DEFAULT_REGISTRY_URL,
1615
- packageName
1616
- );
1617
- if (active) setApplicationIdState(derived);
1618
- } catch (e) {
1619
- console.warn(`[mero-react] could not learn the application id of ${packageName} from the registry`, e);
1620
- }
1621
- }
1622
1625
  } catch {
1623
1626
  }
1624
1627
  })();