@xyo-network/os-react-runtime 4.2.0-rc.1 → 4.2.0-rc.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useDappContextCreator.d.ts","sourceRoot":"","sources":["../../../../src/hooks/os/useDappContextCreator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAC9C,MAAM,uBAAuB,CAAA;AAS9B;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,eACpB,MAAM,GAAG,SAAS,cAClB,MAAM,GAAG,SAAS,SACvB,cAAc,kBACL,UAAU,iBACX,MAAM,EAAE,8BAEtB,iBAAiB,GAAG;IACrB,eAAe,CAAC,EAAE,KAAK,CAAA;CA2DxB,CAAA"}
1
+ {"version":3,"file":"useDappContextCreator.d.ts","sourceRoot":"","sources":["../../../../src/hooks/os/useDappContextCreator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAC9C,MAAM,uBAAuB,CAAA;AAS9B;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,eACpB,MAAM,GAAG,SAAS,cAClB,MAAM,GAAG,SAAS,SACvB,cAAc,kBACL,UAAU,iBACX,MAAM,EAAE,8BAEtB,iBAAiB,GAAG;IACrB,eAAe,CAAC,EAAE,KAAK,CAAA;CAgExB,CAAA"}
@@ -167,7 +167,7 @@ import { FlexCol as FlexCol13 } from "@xylabs/react-flexbox";
167
167
  import React33 from "react";
168
168
 
169
169
  // src/modules/Dapp/Container.tsx
170
- import React26, { useMemo as useMemo13 } from "react";
170
+ import React26, { memo, useMemo as useMemo13 } from "react";
171
171
 
172
172
  // src/hooks/access-requests/useBuildDappAccessRequestResource.ts
173
173
  import { usePromise } from "@xylabs/react-promise";
@@ -639,6 +639,7 @@ var useDappContextCreator = /* @__PURE__ */ __name((xnsNodeUrl, xnsNetwork, dapp
639
639
  dappWallet: void 0
640
640
  });
641
641
  const [dappWindowNodeError, setDappWindowNodeError] = useState3();
642
+ const targetedDapp = !!(dapp && context && currentIntent?.targetDappId === dapp?.config.name);
642
643
  const windowDappNodeSetRef = useRef(windowDappNodeSet);
643
644
  useEffect7(() => {
644
645
  windowDappNodeSetRef.current = windowDappNodeSet;
@@ -646,7 +647,7 @@ var useDappContextCreator = /* @__PURE__ */ __name((xnsNodeUrl, xnsNetwork, dapp
646
647
  windowDappNodeSet
647
648
  ]);
648
649
  const createNode = useCallback3(async () => {
649
- if (dapp && context) {
650
+ if (targetedDapp) {
650
651
  try {
651
652
  const windowDappNodeSet2 = await RunningDappCache.findOrCreate(dapp, context, allowedNames ?? [], xnsNodeUrl, xnsNetwork);
652
653
  setWindowDappNodeSet(windowDappNodeSet2);
@@ -656,6 +657,7 @@ var useDappContextCreator = /* @__PURE__ */ __name((xnsNodeUrl, xnsNetwork, dapp
656
657
  }
657
658
  }, [
658
659
  dapp,
660
+ currentIntent,
659
661
  context,
660
662
  allowedNames
661
663
  ]);
@@ -670,22 +672,24 @@ var useDappContextCreator = /* @__PURE__ */ __name((xnsNodeUrl, xnsNetwork, dapp
670
672
  createNode
671
673
  ]);
672
674
  useAsyncEffect2(async () => {
673
- switch (currentIntent?.intent) {
674
- case DappIntentTypes4.Launch: {
675
- await createNode();
676
- break;
677
- }
678
- case DappIntentTypes4.Close: {
679
- if (windowDappNodeSetRef.current.context) {
680
- await DappContextCreator.resetDappArchivist(windowDappNodeSetRef.current.context);
681
- setWindowDappNodeSet({
682
- context: null,
683
- dappWallet: void 0
684
- });
675
+ if (targetedDapp) {
676
+ switch (currentIntent?.intent) {
677
+ case DappIntentTypes4.Launch: {
678
+ await createNode();
679
+ break;
680
+ }
681
+ case DappIntentTypes4.Close: {
682
+ if (windowDappNodeSetRef.current.context) {
683
+ await DappContextCreator.resetDappArchivist(windowDappNodeSetRef.current.context);
684
+ setWindowDappNodeSet({
685
+ context: null,
686
+ dappWallet: void 0
687
+ });
688
+ }
689
+ break;
685
690
  }
686
- break;
691
+ case DappIntentTypes4.Minimize:
687
692
  }
688
- case DappIntentTypes4.Minimize:
689
693
  }
690
694
  }, [
691
695
  createNode,
@@ -3240,6 +3244,7 @@ var DappContainer = /* @__PURE__ */ __name(({ currentIntent, dappSet, xnsNodeUrl
3240
3244
  nodeCreateError
3241
3245
  }));
3242
3246
  }, "DappContainer");
3247
+ var DappContainerMemo = /* @__PURE__ */ memo(DappContainer);
3243
3248
 
3244
3249
  // src/modules/Dapp/ContainerFlexbox.tsx
3245
3250
  import { Container as Container2 } from "@mui/material";
@@ -3301,7 +3306,7 @@ var DappsRow = /* @__PURE__ */ __name(({ chipLabel, installType, registeredDapps
3301
3306
  })), filteredRegisteredDappSets?.length ? /* @__PURE__ */ React29.createElement(Fade2, {
3302
3307
  in: !!filteredRegisteredDappSets?.length,
3303
3308
  timeout: 1e3
3304
- }, /* @__PURE__ */ React29.createElement(StyledGridContainer, null, filteredRegisteredDappSets?.map((dappSet, index) => /* @__PURE__ */ React29.createElement(DappContainer, {
3309
+ }, /* @__PURE__ */ React29.createElement(StyledGridContainer, null, filteredRegisteredDappSets?.map((dappSet, index) => /* @__PURE__ */ React29.createElement(DappContainerMemo, {
3305
3310
  currentIntent: intentPayload,
3306
3311
  key: index,
3307
3312
  dappSet,
@@ -4844,6 +4849,7 @@ export {
4844
4849
  DappChrome,
4845
4850
  DappChromeLarge,
4846
4851
  DappContainer,
4852
+ DappContainerMemo,
4847
4853
  DappInstallTypeFilters,
4848
4854
  DappIntentResourceHooks,
4849
4855
  DappMenuDrawer,