@skip-go/widget 1.2.4 → 1.2.5
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/build/index.es.js +9 -7
- package/build/index.es.js.map +1 -1
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -1889,7 +1889,7 @@ function useSwapWidget() {
|
|
|
1889
1889
|
const { assetsByChainID, getFeeAsset, isReady: isAssetsReady, getAsset, } = useAssets();
|
|
1890
1890
|
const { data: chains } = useChains({
|
|
1891
1891
|
select: (chains) => {
|
|
1892
|
-
if (
|
|
1892
|
+
if (allChainIDs.length === 0)
|
|
1893
1893
|
return chains;
|
|
1894
1894
|
return chains === null || chains === void 0 ? void 0 : chains.filter(({ chainID }) => {
|
|
1895
1895
|
return allChainIDs.includes(chainID);
|
|
@@ -2475,9 +2475,10 @@ function useSwapWidget() {
|
|
|
2475
2475
|
if (!chains || !isAssetsReady || srcChain)
|
|
2476
2476
|
return;
|
|
2477
2477
|
if (defaultSourceChain) {
|
|
2478
|
-
const
|
|
2479
|
-
.filter((c) => sourceChainIDs === null || sourceChainIDs === void 0 ? void 0 : sourceChainIDs.includes(c.chainID))
|
|
2480
|
-
|
|
2478
|
+
const filteredChains = sourceChainIDs
|
|
2479
|
+
? chains.filter((c) => sourceChainIDs === null || sourceChainIDs === void 0 ? void 0 : sourceChainIDs.includes(c.chainID))
|
|
2480
|
+
: chains;
|
|
2481
|
+
const findChain = filteredChains.find((x) => x.chainID.toLowerCase() === defaultSourceChain.toLowerCase());
|
|
2481
2482
|
if (findChain) {
|
|
2482
2483
|
if (defaultSourceAsset) {
|
|
2483
2484
|
const assets = assetsByChainID(findChain.chainID, (_a = filter === null || filter === void 0 ? void 0 : filter.source) === null || _a === void 0 ? void 0 : _a[findChain.chainID]);
|
|
@@ -2502,9 +2503,10 @@ function useSwapWidget() {
|
|
|
2502
2503
|
if (!chains || !isAssetsReady || dstChain)
|
|
2503
2504
|
return;
|
|
2504
2505
|
if (defaultDestinationChain) {
|
|
2505
|
-
const
|
|
2506
|
-
.filter((c) => destinationChainIDs === null || destinationChainIDs === void 0 ? void 0 : destinationChainIDs.includes(c.chainID))
|
|
2507
|
-
|
|
2506
|
+
const filteredChains = destinationChainIDs
|
|
2507
|
+
? chains.filter((c) => destinationChainIDs === null || destinationChainIDs === void 0 ? void 0 : destinationChainIDs.includes(c.chainID))
|
|
2508
|
+
: chains;
|
|
2509
|
+
const findChain = filteredChains.find((x) => x.chainID.toLowerCase() === defaultDestinationChain.toLowerCase());
|
|
2508
2510
|
if (findChain) {
|
|
2509
2511
|
if (defaultDestinationAsset) {
|
|
2510
2512
|
const assets = assetsByChainID(findChain.chainID, (_a = filter === null || filter === void 0 ? void 0 : filter.destination) === null || _a === void 0 ? void 0 : _a[findChain.chainID]);
|