@tonconnect/ui 2.0.9-beta.0 → 2.0.9-beta.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.
package/lib/index.cjs CHANGED
@@ -8367,22 +8367,18 @@ function redirectToTelegram(universalLink, options) {
8367
8367
  }
8368
8368
  if (isInTelegramBrowser()) {
8369
8369
  options.returnStrategy = "back";
8370
- options.twaReturnUrl = void 0;
8371
- const linkWitStrategy = addReturnStrategy(directLinkUrl.toString(), options);
8370
+ const linkWitStrategy = addReturnStrategy(directLinkUrl.toString(), options.returnStrategy);
8372
8371
  openLinkBlank(linkWitStrategy);
8373
8372
  } else if (isInTMA()) {
8374
- if (isTmaPlatform("ios", "android", "macos")) {
8373
+ if (isTmaPlatform("ios", "android", "macos", "tdesktop", "web")) {
8375
8374
  options.returnStrategy = "back";
8376
- options.twaReturnUrl = void 0;
8377
- sendOpenTelegramLink(addReturnStrategy(directLinkUrl.toString(), options));
8378
- } else if (isTmaPlatform("tdesktop")) {
8379
- sendOpenTelegramLink(addReturnStrategy(directLinkUrl.toString(), options));
8375
+ const linkWitStrategy = addReturnStrategy(
8376
+ directLinkUrl.toString(),
8377
+ options.returnStrategy
8378
+ );
8379
+ sendOpenTelegramLink(linkWitStrategy);
8380
8380
  } else if (isTmaPlatform("weba")) {
8381
8381
  sendOpenTelegramLink(addReturnStrategy(directLinkUrl.toString(), options));
8382
- } else if (isTmaPlatform("web")) {
8383
- options.returnStrategy = "back";
8384
- options.twaReturnUrl = void 0;
8385
- sendOpenTelegramLink(addReturnStrategy(directLinkUrl.toString(), options));
8386
8382
  } else {
8387
8383
  openLinkBlank(addReturnStrategy(directLinkUrl.toString(), options));
8388
8384
  }
@@ -8419,7 +8415,7 @@ function redirectToTelegram(universalLink, options) {
8419
8415
  openLinkBlank(linkWithStrategy);
8420
8416
  }
8421
8417
  } else if (isOS("android")) {
8422
- options.returnStrategy = "none";
8418
+ options.returnStrategy = "back";
8423
8419
  const isChrome = isBrowser("chrome");
8424
8420
  const isFirefox = isBrowser("firefox");
8425
8421
  const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect;
@@ -8469,7 +8465,7 @@ function redirectToTelegram(universalLink, options) {
8469
8465
  openLinkBlank(linkWithStrategy);
8470
8466
  }
8471
8467
  } else if (isOS("macos", "windows", "linux")) {
8472
- options.returnStrategy = "none";
8468
+ options.returnStrategy = "back";
8473
8469
  options.twaReturnUrl = void 0;
8474
8470
  if (options.forceRedirect) {
8475
8471
  openLinkBlank(addReturnStrategy(directLinkUrl.toString(), options));
@@ -8733,16 +8729,20 @@ const DesktopConnectionModal = (props) => {
8733
8729
  generateUniversalLink();
8734
8730
  }
8735
8731
  setMode("desktop");
8736
- const forceRedirect = !firstClick();
8737
- setFirstClick(false);
8738
- redirectToWallet(universalLink(), props.wallet.deepLink, {
8739
- returnStrategy: appState.returnStrategy,
8740
- forceRedirect
8741
- }, (method) => {
8742
- setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, props.wallet), {
8743
- openMethod: method
8744
- }));
8745
- });
8732
+ if (sdk.isTelegramUrl(universalLink())) {
8733
+ onClickTelegram();
8734
+ } else {
8735
+ const forceRedirect = !firstClick();
8736
+ setFirstClick(false);
8737
+ redirectToWallet(universalLink(), props.wallet.deepLink, {
8738
+ returnStrategy: appState.returnStrategy,
8739
+ forceRedirect
8740
+ }, (method) => {
8741
+ setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, props.wallet), {
8742
+ openMethod: method
8743
+ }));
8744
+ });
8745
+ }
8746
8746
  };
8747
8747
  const onClickTelegram = () => {
8748
8748
  const forceRedirect = !firstClick();
@@ -10965,7 +10965,7 @@ class TonConnectUITracker {
10965
10965
  }
10966
10966
  }
10967
10967
  }
10968
- const tonConnectUiVersion = "2.0.9-beta.0";
10968
+ const tonConnectUiVersion = "2.0.9-beta.2";
10969
10969
  class TonConnectUI {
10970
10970
  constructor(options) {
10971
10971
  __publicField(this, "walletInfoStorage", new WalletInfoStorage());