@owney/sdk 0.8.3 → 0.8.4
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.cjs +5 -2
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1017,11 +1017,14 @@ var BrowserSessionStore = class {
|
|
|
1017
1017
|
function buildAutoSelectUpdate(current, asset, chainId) {
|
|
1018
1018
|
const chains = current.chains ?? [];
|
|
1019
1019
|
const chainMissing = chainId !== void 0 && !chains.includes(chainId);
|
|
1020
|
-
|
|
1020
|
+
const explicitlyOff = current.autoSelectProtocols === false;
|
|
1021
|
+
const enable = current.autoSelectProtocols == null;
|
|
1022
|
+
if (!enable && !chainMissing) return null;
|
|
1021
1023
|
const nextChains = chainMissing ? [...chains, chainId] : chains;
|
|
1024
|
+
if (explicitlyOff && !nextChains.length) return null;
|
|
1022
1025
|
return {
|
|
1023
1026
|
asset,
|
|
1024
|
-
autoSelectProtocols: true,
|
|
1027
|
+
...explicitlyOff ? {} : { autoSelectProtocols: true },
|
|
1025
1028
|
...nextChains.length ? { chains: nextChains } : {}
|
|
1026
1029
|
};
|
|
1027
1030
|
}
|
package/dist/index.js
CHANGED
|
@@ -976,11 +976,14 @@ var BrowserSessionStore = class {
|
|
|
976
976
|
function buildAutoSelectUpdate(current, asset, chainId) {
|
|
977
977
|
const chains = current.chains ?? [];
|
|
978
978
|
const chainMissing = chainId !== void 0 && !chains.includes(chainId);
|
|
979
|
-
|
|
979
|
+
const explicitlyOff = current.autoSelectProtocols === false;
|
|
980
|
+
const enable = current.autoSelectProtocols == null;
|
|
981
|
+
if (!enable && !chainMissing) return null;
|
|
980
982
|
const nextChains = chainMissing ? [...chains, chainId] : chains;
|
|
983
|
+
if (explicitlyOff && !nextChains.length) return null;
|
|
981
984
|
return {
|
|
982
985
|
asset,
|
|
983
|
-
autoSelectProtocols: true,
|
|
986
|
+
...explicitlyOff ? {} : { autoSelectProtocols: true },
|
|
984
987
|
...nextChains.length ? { chains: nextChains } : {}
|
|
985
988
|
};
|
|
986
989
|
}
|