@multiversx/sdk-dapp-liquidity 1.1.0-alpha.30 → 1.1.0-alpha.31

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/package.json CHANGED
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/multiversx/mx-sdk-dapp-liquidity#readme",
30
30
  "license": "MIT",
31
- "version": "1.1.0-alpha.30",
31
+ "version": "1.1.0-alpha.31",
32
32
  "main": "index.js",
33
33
  "module": "index.mjs",
34
34
  "types": "index.d.ts",
@@ -365,6 +365,17 @@ const BridgeForm = ({
365
365
  },
366
366
  [fromOptions, updateUrlParams]
367
367
  );
368
+ React.useEffect(() => {
369
+ if ((selectedChainOption == null ? void 0 : selectedChainOption.chainId) !== (firstToken == null ? void 0 : firstToken.chainId)) {
370
+ const selectedOption = fromOptions == null ? void 0 : fromOptions.find(
371
+ (option) => option.chainId.toString() === (selectedChainOption == null ? void 0 : selectedChainOption.chainId)
372
+ );
373
+ if (!selectedOption) {
374
+ return;
375
+ }
376
+ onChangeFirstSelect(selectedOption);
377
+ }
378
+ }, [selectedChainOption == null ? void 0 : selectedChainOption.chainId]);
368
379
  const setInitialSelectedTokens = () => {
369
380
  var _a2, _b2, _c2, _d2;
370
381
  if (isTokensLoading || initializedInitialTokensRef.current) {
@@ -362,6 +362,17 @@ const BridgeForm = ({
362
362
  },
363
363
  [fromOptions, updateUrlParams]
364
364
  );
365
+ useEffect(() => {
366
+ if ((selectedChainOption == null ? void 0 : selectedChainOption.chainId) !== (firstToken == null ? void 0 : firstToken.chainId)) {
367
+ const selectedOption = fromOptions == null ? void 0 : fromOptions.find(
368
+ (option) => option.chainId.toString() === (selectedChainOption == null ? void 0 : selectedChainOption.chainId)
369
+ );
370
+ if (!selectedOption) {
371
+ return;
372
+ }
373
+ onChangeFirstSelect(selectedOption);
374
+ }
375
+ }, [selectedChainOption == null ? void 0 : selectedChainOption.chainId]);
365
376
  const setInitialSelectedTokens = () => {
366
377
  var _a2, _b2, _c2, _d2;
367
378
  if (isTokensLoading || initializedInitialTokensRef.current) {