@tonconnect/ui 2.0.1-beta.0 → 2.0.1-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/dist/tonconnect-ui.min.js +183 -183
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.cjs +254 -47
- package/lib/index.cjs.map +1 -1
- package/lib/index.mjs +254 -47
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -1754,7 +1754,32 @@ class TonConnectUIError extends sdk.TonConnectError {
|
|
|
1754
1754
|
Object.setPrototypeOf(this, TonConnectUIError.prototype);
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
|
+
function logDebug(...args) {
|
|
1758
|
+
{
|
|
1759
|
+
try {
|
|
1760
|
+
console.debug("[TON_CONNECT_UI]", ...args);
|
|
1761
|
+
} catch (e2) {
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
function logError(...args) {
|
|
1766
|
+
{
|
|
1767
|
+
try {
|
|
1768
|
+
console.error("[TON_CONNECT_UI]", ...args);
|
|
1769
|
+
} catch (e2) {
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
function logWarning(...args) {
|
|
1774
|
+
{
|
|
1775
|
+
try {
|
|
1776
|
+
console.warn("[TON_CONNECT_UI]", ...args);
|
|
1777
|
+
} catch (e2) {
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1757
1781
|
function openLink(href, target = "_self") {
|
|
1782
|
+
logDebug("openLink", href, target);
|
|
1758
1783
|
window.open(href, target, "noopener noreferrer");
|
|
1759
1784
|
}
|
|
1760
1785
|
function openLinkBlank(href) {
|
|
@@ -1762,7 +1787,7 @@ function openLinkBlank(href) {
|
|
|
1762
1787
|
}
|
|
1763
1788
|
function openDeeplinkWithFallback(href, fallback) {
|
|
1764
1789
|
const doFallback = () => {
|
|
1765
|
-
if (isBrowser("safari")) {
|
|
1790
|
+
if (isBrowser("safari") || isOS("android") && isBrowser("firefox")) {
|
|
1766
1791
|
return;
|
|
1767
1792
|
}
|
|
1768
1793
|
fallback();
|
|
@@ -1882,6 +1907,9 @@ function getUserAgent() {
|
|
|
1882
1907
|
case (browserName == null ? void 0 : browserName.includes("safari")):
|
|
1883
1908
|
browser = "safari";
|
|
1884
1909
|
break;
|
|
1910
|
+
case (browserName == null ? void 0 : browserName.includes("opera")):
|
|
1911
|
+
browser = "opera";
|
|
1912
|
+
break;
|
|
1885
1913
|
}
|
|
1886
1914
|
return {
|
|
1887
1915
|
os,
|
|
@@ -2631,22 +2659,6 @@ const Image = (props) => {
|
|
|
2631
2659
|
}
|
|
2632
2660
|
})];
|
|
2633
2661
|
};
|
|
2634
|
-
function logError(...args) {
|
|
2635
|
-
{
|
|
2636
|
-
try {
|
|
2637
|
-
console.error("[TON_CONNECT_UI]", ...args);
|
|
2638
|
-
} catch (e2) {
|
|
2639
|
-
}
|
|
2640
|
-
}
|
|
2641
|
-
}
|
|
2642
|
-
function logWarning(...args) {
|
|
2643
|
-
{
|
|
2644
|
-
try {
|
|
2645
|
-
console.warn("[TON_CONNECT_UI]", ...args);
|
|
2646
|
-
} catch (e2) {
|
|
2647
|
-
}
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
2662
|
let initParams = {};
|
|
2651
2663
|
try {
|
|
2652
2664
|
let locationHash = location.hash.toString();
|
|
@@ -2679,12 +2691,18 @@ function isInTMA() {
|
|
|
2679
2691
|
function sendExpand() {
|
|
2680
2692
|
postEvent("web_app_expand", {});
|
|
2681
2693
|
}
|
|
2682
|
-
function sendOpenTelegramLink(link) {
|
|
2694
|
+
function sendOpenTelegramLink(link, fallback) {
|
|
2683
2695
|
const url = new URL(link);
|
|
2684
2696
|
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
2697
|
+
if (fallback) {
|
|
2698
|
+
return fallback();
|
|
2699
|
+
}
|
|
2685
2700
|
throw new TonConnectUIError(`Url protocol is not supported: ${url}`);
|
|
2686
2701
|
}
|
|
2687
2702
|
if (url.hostname !== "t.me") {
|
|
2703
|
+
if (fallback) {
|
|
2704
|
+
return fallback();
|
|
2705
|
+
}
|
|
2688
2706
|
throw new TonConnectUIError(`Url host is not supported: ${url}`);
|
|
2689
2707
|
}
|
|
2690
2708
|
const pathFull = url.pathname + url.search;
|
|
@@ -2712,12 +2730,15 @@ function postEvent(eventType, eventData) {
|
|
|
2712
2730
|
throw new TonConnectUIError(`Can't post event to parent window: window is not defined`);
|
|
2713
2731
|
}
|
|
2714
2732
|
if (window2.TelegramWebviewProxy !== void 0) {
|
|
2733
|
+
logDebug("postEvent", eventType, eventData);
|
|
2715
2734
|
window2.TelegramWebviewProxy.postEvent(eventType, JSON.stringify(eventData));
|
|
2716
2735
|
} else if (window2.external && "notify" in window2.external) {
|
|
2736
|
+
logDebug("postEvent", eventType, eventData);
|
|
2717
2737
|
window2.external.notify(JSON.stringify({ eventType, eventData }));
|
|
2718
2738
|
} else if (isIframe()) {
|
|
2719
2739
|
const trustedTarget = "*";
|
|
2720
2740
|
const message = JSON.stringify({ eventType, eventData });
|
|
2741
|
+
logDebug("postEvent", eventType, eventData);
|
|
2721
2742
|
window2.parent.postMessage(message, trustedTarget);
|
|
2722
2743
|
} else {
|
|
2723
2744
|
throw new TonConnectUIError(`Can't post event to TMA`);
|
|
@@ -2814,7 +2835,7 @@ function isDevice(device) {
|
|
|
2814
2835
|
return width > maxWidth.mobile;
|
|
2815
2836
|
default:
|
|
2816
2837
|
case "mobile":
|
|
2817
|
-
return width <= maxWidth.mobile;
|
|
2838
|
+
return width <= maxWidth.mobile || isOS("ios", "android");
|
|
2818
2839
|
}
|
|
2819
2840
|
}
|
|
2820
2841
|
function media(device) {
|
|
@@ -8314,8 +8335,26 @@ function redirectToTelegram(universalLink, options) {
|
|
|
8314
8335
|
}
|
|
8315
8336
|
} else {
|
|
8316
8337
|
if (isOS("ios", "android")) {
|
|
8317
|
-
options.returnStrategy
|
|
8318
|
-
|
|
8338
|
+
if (options.returnStrategy === "back") {
|
|
8339
|
+
options.returnStrategy = location.href;
|
|
8340
|
+
}
|
|
8341
|
+
const isChrome = isBrowser("chrome");
|
|
8342
|
+
const isFirefox = isBrowser("firefox");
|
|
8343
|
+
const useDeepLink = (isChrome || isFirefox) && !options.forceRedirect;
|
|
8344
|
+
if (useDeepLink) {
|
|
8345
|
+
const linkWithStrategy = addReturnStrategy(
|
|
8346
|
+
directLinkUrl.toString(),
|
|
8347
|
+
options.returnStrategy
|
|
8348
|
+
);
|
|
8349
|
+
const deepLink = convertToTGDeepLink(linkWithStrategy);
|
|
8350
|
+
openDeeplinkWithFallback(deepLink, () => openLinkBlank(linkWithStrategy));
|
|
8351
|
+
} else {
|
|
8352
|
+
const linkWithStrategy = addReturnStrategy(
|
|
8353
|
+
directLinkUrl.toString(),
|
|
8354
|
+
options.returnStrategy
|
|
8355
|
+
);
|
|
8356
|
+
openLinkBlank(linkWithStrategy);
|
|
8357
|
+
}
|
|
8319
8358
|
} else if (isOS("macos", "windows", "linux")) {
|
|
8320
8359
|
options.returnStrategy = "none";
|
|
8321
8360
|
options.twaReturnUrl = void 0;
|
|
@@ -8331,6 +8370,160 @@ function redirectToTelegram(universalLink, options) {
|
|
|
8331
8370
|
}
|
|
8332
8371
|
}
|
|
8333
8372
|
}
|
|
8373
|
+
function redirectToWallet(universalLink, deepLink, options, setOpenMethod) {
|
|
8374
|
+
options = __spreadValues({}, options);
|
|
8375
|
+
if (isInTMA()) {
|
|
8376
|
+
if (isTmaPlatform("ios", "android")) {
|
|
8377
|
+
if (options.returnStrategy === "back") {
|
|
8378
|
+
options.returnStrategy = "tg://resolve";
|
|
8379
|
+
}
|
|
8380
|
+
setOpenMethod("universal-link");
|
|
8381
|
+
const linkWitStrategy = addReturnStrategy(universalLink, options.returnStrategy);
|
|
8382
|
+
sendOpenTelegramLink(linkWitStrategy, () => {
|
|
8383
|
+
setOpenMethod("universal-link");
|
|
8384
|
+
openLinkBlank(linkWitStrategy);
|
|
8385
|
+
});
|
|
8386
|
+
} else if (isTmaPlatform("macos", "tdesktop")) {
|
|
8387
|
+
if (options.returnStrategy === "back") {
|
|
8388
|
+
options.returnStrategy = "tg://resolve";
|
|
8389
|
+
}
|
|
8390
|
+
const linkWitStrategy = addReturnStrategy(universalLink, options.returnStrategy);
|
|
8391
|
+
const useDeepLink = !!deepLink && !options.forceRedirect;
|
|
8392
|
+
if (useDeepLink) {
|
|
8393
|
+
setOpenMethod("custom-deeplink");
|
|
8394
|
+
openDeeplinkWithFallback(toDeeplink(linkWitStrategy, deepLink), () => {
|
|
8395
|
+
setOpenMethod("universal-link");
|
|
8396
|
+
openLinkBlank(linkWitStrategy);
|
|
8397
|
+
});
|
|
8398
|
+
} else {
|
|
8399
|
+
setOpenMethod("universal-link");
|
|
8400
|
+
openLinkBlank(linkWitStrategy);
|
|
8401
|
+
}
|
|
8402
|
+
} else if (isTmaPlatform("weba")) {
|
|
8403
|
+
if (options.returnStrategy === "back") {
|
|
8404
|
+
if (isBrowser("safari")) {
|
|
8405
|
+
options.returnStrategy = location.href;
|
|
8406
|
+
} else if (isBrowser("chrome")) {
|
|
8407
|
+
options.returnStrategy = "googlechrome://";
|
|
8408
|
+
} else if (isBrowser("firefox")) {
|
|
8409
|
+
options.returnStrategy = "firefox://";
|
|
8410
|
+
} else if (isBrowser("opera")) {
|
|
8411
|
+
options.returnStrategy = "opera-http://";
|
|
8412
|
+
} else {
|
|
8413
|
+
options.returnStrategy = location.href;
|
|
8414
|
+
}
|
|
8415
|
+
}
|
|
8416
|
+
const linkWitStrategy = addReturnStrategy(universalLink, options.returnStrategy);
|
|
8417
|
+
const useDeepLink = !!deepLink && !options.forceRedirect;
|
|
8418
|
+
if (useDeepLink) {
|
|
8419
|
+
setOpenMethod("custom-deeplink");
|
|
8420
|
+
openDeeplinkWithFallback(toDeeplink(linkWitStrategy, deepLink), () => {
|
|
8421
|
+
setOpenMethod("universal-link");
|
|
8422
|
+
openLinkBlank(linkWitStrategy);
|
|
8423
|
+
});
|
|
8424
|
+
} else {
|
|
8425
|
+
setOpenMethod("universal-link");
|
|
8426
|
+
openLinkBlank(linkWitStrategy);
|
|
8427
|
+
}
|
|
8428
|
+
} else if (isTmaPlatform("web")) {
|
|
8429
|
+
if (options.returnStrategy === "back") {
|
|
8430
|
+
if (isBrowser("safari")) {
|
|
8431
|
+
options.returnStrategy = location.href;
|
|
8432
|
+
} else if (isBrowser("chrome")) {
|
|
8433
|
+
options.returnStrategy = "googlechrome://";
|
|
8434
|
+
} else if (isBrowser("firefox")) {
|
|
8435
|
+
options.returnStrategy = "firefox://";
|
|
8436
|
+
} else if (isBrowser("opera")) {
|
|
8437
|
+
options.returnStrategy = "opera-http://";
|
|
8438
|
+
} else {
|
|
8439
|
+
options.returnStrategy = location.href;
|
|
8440
|
+
}
|
|
8441
|
+
}
|
|
8442
|
+
const linkWitStrategy = addReturnStrategy(universalLink, options.returnStrategy);
|
|
8443
|
+
const useDeepLink = !!deepLink && !options.forceRedirect;
|
|
8444
|
+
if (useDeepLink) {
|
|
8445
|
+
setOpenMethod("custom-deeplink");
|
|
8446
|
+
openDeeplinkWithFallback(toDeeplink(linkWitStrategy, deepLink), () => {
|
|
8447
|
+
setOpenMethod("universal-link");
|
|
8448
|
+
openLinkBlank(linkWitStrategy);
|
|
8449
|
+
});
|
|
8450
|
+
} else {
|
|
8451
|
+
setOpenMethod("universal-link");
|
|
8452
|
+
openLinkBlank(linkWitStrategy);
|
|
8453
|
+
}
|
|
8454
|
+
} else {
|
|
8455
|
+
setOpenMethod("universal-link");
|
|
8456
|
+
const linkWitStrategy = addReturnStrategy(universalLink, options.returnStrategy);
|
|
8457
|
+
openLinkBlank(linkWitStrategy);
|
|
8458
|
+
}
|
|
8459
|
+
} else {
|
|
8460
|
+
if (isOS("ios")) {
|
|
8461
|
+
if (options.returnStrategy === "back") {
|
|
8462
|
+
if (isBrowser("safari")) {
|
|
8463
|
+
options.returnStrategy = location.href;
|
|
8464
|
+
} else if (isBrowser("chrome")) {
|
|
8465
|
+
options.returnStrategy = "googlechrome://";
|
|
8466
|
+
} else if (isBrowser("firefox")) {
|
|
8467
|
+
options.returnStrategy = "firefox://";
|
|
8468
|
+
} else if (isBrowser("opera")) {
|
|
8469
|
+
options.returnStrategy = "opera-http://";
|
|
8470
|
+
} else {
|
|
8471
|
+
options.returnStrategy = location.href;
|
|
8472
|
+
}
|
|
8473
|
+
}
|
|
8474
|
+
if (isBrowser("chrome")) {
|
|
8475
|
+
setOpenMethod("universal-link");
|
|
8476
|
+
openLink(addReturnStrategy(universalLink, options.returnStrategy), "_self");
|
|
8477
|
+
} else {
|
|
8478
|
+
setOpenMethod("universal-link");
|
|
8479
|
+
openLinkBlank(addReturnStrategy(universalLink, options.returnStrategy));
|
|
8480
|
+
}
|
|
8481
|
+
} else if (isOS("android")) {
|
|
8482
|
+
if (options.returnStrategy === "back") {
|
|
8483
|
+
if (isBrowser("chrome")) {
|
|
8484
|
+
options.returnStrategy = "googlechrome://";
|
|
8485
|
+
} else if (isBrowser("firefox")) {
|
|
8486
|
+
options.returnStrategy = "firefox://";
|
|
8487
|
+
} else if (isBrowser("opera")) {
|
|
8488
|
+
options.returnStrategy = "opera-http://";
|
|
8489
|
+
} else {
|
|
8490
|
+
options.returnStrategy = location.href;
|
|
8491
|
+
}
|
|
8492
|
+
}
|
|
8493
|
+
setOpenMethod("universal-link");
|
|
8494
|
+
openLinkBlank(addReturnStrategy(universalLink, options.returnStrategy));
|
|
8495
|
+
} else if (isOS("macos", "windows", "linux")) {
|
|
8496
|
+
if (options.returnStrategy === "back") {
|
|
8497
|
+
if (isBrowser("safari")) {
|
|
8498
|
+
options.returnStrategy = "none";
|
|
8499
|
+
} else if (isBrowser("chrome")) {
|
|
8500
|
+
options.returnStrategy = "googlechrome://";
|
|
8501
|
+
} else if (isBrowser("firefox")) {
|
|
8502
|
+
options.returnStrategy = "firefox://";
|
|
8503
|
+
} else if (isBrowser("opera")) {
|
|
8504
|
+
options.returnStrategy = "opera-http://";
|
|
8505
|
+
} else {
|
|
8506
|
+
options.returnStrategy = "none";
|
|
8507
|
+
}
|
|
8508
|
+
}
|
|
8509
|
+
const linkWitStrategy = addReturnStrategy(universalLink, options.returnStrategy);
|
|
8510
|
+
const useDeepLink = !!deepLink && !options.forceRedirect;
|
|
8511
|
+
if (useDeepLink) {
|
|
8512
|
+
setOpenMethod("custom-deeplink");
|
|
8513
|
+
openDeeplinkWithFallback(toDeeplink(linkWitStrategy, deepLink), () => {
|
|
8514
|
+
setOpenMethod("universal-link");
|
|
8515
|
+
openLinkBlank(linkWitStrategy);
|
|
8516
|
+
});
|
|
8517
|
+
} else {
|
|
8518
|
+
setOpenMethod("universal-link");
|
|
8519
|
+
openLinkBlank(linkWitStrategy);
|
|
8520
|
+
}
|
|
8521
|
+
} else {
|
|
8522
|
+
setOpenMethod("universal-link");
|
|
8523
|
+
openLinkBlank(addReturnStrategy(universalLink, options.returnStrategy));
|
|
8524
|
+
}
|
|
8525
|
+
}
|
|
8526
|
+
}
|
|
8334
8527
|
function addQueryParameter(url, key, value) {
|
|
8335
8528
|
const parsed = new URL(url);
|
|
8336
8529
|
parsed.searchParams.append(key, value);
|
|
@@ -8350,7 +8543,6 @@ function convertToTGDeepLink(directLink) {
|
|
|
8350
8543
|
const startapp = parsed.searchParams.get("startapp");
|
|
8351
8544
|
return `tg://resolve?domain=${domain}&appname=${appname}&startapp=${startapp}`;
|
|
8352
8545
|
}
|
|
8353
|
-
let openDesktopDeeplinkAttempts = 0;
|
|
8354
8546
|
const DesktopConnectionModal = (props) => {
|
|
8355
8547
|
const [mode, setMode] = createSignal("mobile");
|
|
8356
8548
|
const [connectionErrored, setConnectionErrored] = createSignal(false);
|
|
@@ -8391,25 +8583,16 @@ const DesktopConnectionModal = (props) => {
|
|
|
8391
8583
|
generateUniversalLink();
|
|
8392
8584
|
}
|
|
8393
8585
|
setMode("desktop");
|
|
8394
|
-
const
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
}));
|
|
8401
|
-
openDeeplinkWithFallback(toDeeplink(linkWithStrategy, props.wallet.deepLink), () => {
|
|
8402
|
-
setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, props.wallet), {
|
|
8403
|
-
openMethod: "universal-link"
|
|
8404
|
-
}));
|
|
8405
|
-
openLinkBlank(linkWithStrategy);
|
|
8406
|
-
});
|
|
8407
|
-
} else {
|
|
8586
|
+
const forceRedirect = !firstClick();
|
|
8587
|
+
setFirstClick(false);
|
|
8588
|
+
redirectToWallet(universalLink(), props.wallet.deepLink, {
|
|
8589
|
+
returnStrategy: appState.returnStrategy,
|
|
8590
|
+
forceRedirect
|
|
8591
|
+
}, (method) => {
|
|
8408
8592
|
setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, props.wallet), {
|
|
8409
|
-
openMethod:
|
|
8593
|
+
openMethod: method
|
|
8410
8594
|
}));
|
|
8411
|
-
|
|
8412
|
-
}
|
|
8595
|
+
});
|
|
8413
8596
|
};
|
|
8414
8597
|
const onClickTelegram = () => {
|
|
8415
8598
|
const forceRedirect = !firstClick();
|
|
@@ -8979,6 +9162,7 @@ const MobileConnectionQR = (props) => {
|
|
|
8979
9162
|
};
|
|
8980
9163
|
const MobileConnectionModal = (props) => {
|
|
8981
9164
|
const theme = useTheme();
|
|
9165
|
+
const [firstClick, setFirstClick] = createSignal(true);
|
|
8982
9166
|
const [showQR, setShowQR] = createSignal(false);
|
|
8983
9167
|
const [connectionErrored, setConnectionErrored] = createSignal(false);
|
|
8984
9168
|
const connector = useContext(ConnectorContext);
|
|
@@ -9007,10 +9191,16 @@ const MobileConnectionModal = (props) => {
|
|
|
9007
9191
|
return onClickTelegram();
|
|
9008
9192
|
}
|
|
9009
9193
|
setConnectionErrored(false);
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9194
|
+
const forceRedirect = !firstClick();
|
|
9195
|
+
setFirstClick(false);
|
|
9196
|
+
redirectToWallet(universalLink(), props.wallet.deepLink, {
|
|
9197
|
+
returnStrategy: appState.returnStrategy,
|
|
9198
|
+
forceRedirect
|
|
9199
|
+
}, (method) => {
|
|
9200
|
+
setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, props.wallet), {
|
|
9201
|
+
openMethod: method
|
|
9202
|
+
}));
|
|
9203
|
+
});
|
|
9014
9204
|
};
|
|
9015
9205
|
const onOpenQR = () => {
|
|
9016
9206
|
setConnectionErrored(false);
|
|
@@ -9374,7 +9564,16 @@ const MobileUniversalModal = (props) => {
|
|
|
9374
9564
|
setIsCopiedShown(timeoutId);
|
|
9375
9565
|
});
|
|
9376
9566
|
const onSelectUniversal = () => {
|
|
9377
|
-
|
|
9567
|
+
const forceRedirect = !firstClick();
|
|
9568
|
+
setFirstClick(false);
|
|
9569
|
+
redirectToWallet(getUniversalLink(), void 0, {
|
|
9570
|
+
returnStrategy: appState.returnStrategy,
|
|
9571
|
+
forceRedirect
|
|
9572
|
+
}, (method) => {
|
|
9573
|
+
setLastSelectedWalletInfo({
|
|
9574
|
+
openMethod: method
|
|
9575
|
+
});
|
|
9576
|
+
});
|
|
9378
9577
|
};
|
|
9379
9578
|
const onSelectTelegram = () => {
|
|
9380
9579
|
const atWallet = props.walletsList.find((wallet) => wallet.appName === AT_WALLET_APP_NAME);
|
|
@@ -9896,19 +10095,27 @@ const ActionModal = (props) => {
|
|
|
9896
10095
|
if ((tonConnectUI == null ? void 0 : tonConnectUI.wallet) && "universalLink" in tonConnectUI.wallet && (tonConnectUI.wallet.openMethod === "universal-link" || sdk.isTelegramUrl(tonConnectUI.wallet.universalLink) && isInTMA())) {
|
|
9897
10096
|
universalLink = tonConnectUI.wallet.universalLink;
|
|
9898
10097
|
}
|
|
10098
|
+
let deepLink;
|
|
10099
|
+
if ((tonConnectUI == null ? void 0 : tonConnectUI.wallet) && "deepLink" in tonConnectUI.wallet && (tonConnectUI.wallet.openMethod === "custom-deeplink" || sdk.isTelegramUrl(tonConnectUI.wallet.deepLink) && isInTMA())) {
|
|
10100
|
+
deepLink = tonConnectUI.wallet.deepLink;
|
|
10101
|
+
}
|
|
9899
10102
|
const onOpenWallet = () => {
|
|
9900
10103
|
const currentAction = action();
|
|
9901
10104
|
const returnStrategy = "returnStrategy" in currentAction ? currentAction.returnStrategy : appState.returnStrategy;
|
|
10105
|
+
const forceRedirect = !firstClick();
|
|
10106
|
+
setFirstClick(false);
|
|
9902
10107
|
if (sdk.isTelegramUrl(universalLink)) {
|
|
9903
|
-
const forceRedirect = !firstClick();
|
|
9904
|
-
setFirstClick(false);
|
|
9905
10108
|
redirectToTelegram(universalLink, {
|
|
9906
10109
|
returnStrategy,
|
|
9907
10110
|
twaReturnUrl: "twaReturnUrl" in currentAction ? currentAction.twaReturnUrl : appState.twaReturnUrl,
|
|
9908
10111
|
forceRedirect
|
|
9909
10112
|
});
|
|
9910
10113
|
} else {
|
|
9911
|
-
|
|
10114
|
+
redirectToWallet(universalLink, deepLink, {
|
|
10115
|
+
returnStrategy,
|
|
10116
|
+
forceRedirect
|
|
10117
|
+
}, () => {
|
|
10118
|
+
});
|
|
9912
10119
|
}
|
|
9913
10120
|
};
|
|
9914
10121
|
return createComponent(ActionModalStyled, mergeProps(dataAttrs, {
|