@tonconnect/ui 0.0.12 → 0.0.13

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.umd.js CHANGED
@@ -5304,9 +5304,7 @@ var __async = (__this, __arguments, generator) => {
5304
5304
  });
5305
5305
  }
5306
5306
  const [walletsModalOpen, setWalletsModalOpen] = createSignal(false);
5307
- const [lastSelectedWalletInfo, setLastSelectedWalletInfo] = createSignal(
5308
- null
5309
- );
5307
+ const [lastSelectedWalletInfo, setLastSelectedWalletInfo] = createSignal(null);
5310
5308
  const [action, setAction] = createSignal(null);
5311
5309
  let e = { data: "" }, t = (t2) => "object" == typeof window ? ((t2 ? t2.querySelector("#_goober") : window._goober) || Object.assign((t2 || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : t2 || e, l = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, a = /\/\*[^]*?\*\/| +/g, n = /\n+/g, o = (e2, t2) => {
5312
5310
  let r = "", l2 = "", a2 = "";
@@ -5827,8 +5825,7 @@ var __async = (__this, __arguments, generator) => {
5827
5825
  },
5828
5826
  text: {
5829
5827
  primary: "#0F0F0F",
5830
- secondary: "#7A8999",
5831
- subhead: "#6A7785"
5828
+ secondary: "#7A8999"
5832
5829
  }
5833
5830
  };
5834
5831
  const defaultDarkColorsSet = {
@@ -5853,8 +5850,7 @@ var __async = (__this, __arguments, generator) => {
5853
5850
  },
5854
5851
  text: {
5855
5852
  primary: "#E5E5EA",
5856
- secondary: "#7D7D85",
5857
- subhead: "#8C8C93"
5853
+ secondary: "#7D7D85"
5858
5854
  }
5859
5855
  };
5860
5856
  var isMergeableObject = function isMergeableObject2(value) {
@@ -6099,7 +6095,7 @@ var __async = (__this, __arguments, generator) => {
6099
6095
  padding: 9px 16px;
6100
6096
  border: none;
6101
6097
  border-radius: ${(props) => borders$3[props.theme.borderRadius]};
6102
- cursor: pointer;
6098
+ cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
6103
6099
 
6104
6100
  font-size: 14px;
6105
6101
  font-weight: 590;
@@ -6109,11 +6105,11 @@ var __async = (__this, __arguments, generator) => {
6109
6105
  transition: transform 0.1s ease-in-out;
6110
6106
 
6111
6107
  &:hover {
6112
- transform: scale(1.04);
6108
+ transform: ${(props) => props.disabled ? "unset" : "scale(1.04)"};
6113
6109
  }
6114
6110
 
6115
6111
  &:active {
6116
- transform: scale(0.96);
6112
+ transform: ${(props) => props.disabled ? "unset" : "scale(0.96)"};
6117
6113
  }
6118
6114
  `;
6119
6115
  const Button = (props) => {
@@ -6124,11 +6120,17 @@ var __async = (__this, __arguments, generator) => {
6124
6120
  get id() {
6125
6121
  return props.id;
6126
6122
  },
6127
- onClick: () => props.onClick(),
6123
+ onClick: () => {
6124
+ var _a2;
6125
+ return (_a2 = props.onClick) == null ? void 0 : _a2.call(props);
6126
+ },
6128
6127
  ref(r$) {
6129
6128
  const _ref$ = props.ref;
6130
6129
  typeof _ref$ === "function" ? _ref$(r$) : props.ref = r$;
6131
6130
  },
6131
+ get disabled() {
6132
+ return props.disabled;
6133
+ },
6132
6134
  get children() {
6133
6135
  return props.children;
6134
6136
  }
@@ -6916,38 +6918,42 @@ var __async = (__this, __arguments, generator) => {
6916
6918
  return _el$;
6917
6919
  })();
6918
6920
  };
6919
- const _tmpl$$b = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M7.5 13L10 15.5L16.5 9" stroke="white" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
6921
+ const _tmpl$$b = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path d="M7.5 13L10 15.5L16.5 9" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
6920
6922
  const SuccessIcon = (props) => {
6921
6923
  const theme = useTheme();
6922
6924
  const fill = () => props.fill || theme.colors.icon.success;
6923
6925
  return (() => {
6924
- const _el$ = _tmpl$$b.cloneNode(true), _el$2 = _el$.firstChild;
6926
+ const _el$ = _tmpl$$b.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
6925
6927
  createRenderEffect((_p$) => {
6926
- const _v$ = props.class, _v$2 = fill();
6928
+ const _v$ = props.class, _v$2 = fill(), _v$3 = theme.colors.constant.white;
6927
6929
  _v$ !== _p$._v$ && setAttribute(_el$, "class", _p$._v$ = _v$);
6928
6930
  _v$2 !== _p$._v$2 && setAttribute(_el$2, "fill", _p$._v$2 = _v$2);
6931
+ _v$3 !== _p$._v$3 && setAttribute(_el$3, "stroke", _p$._v$3 = _v$3);
6929
6932
  return _p$;
6930
6933
  }, {
6931
6934
  _v$: void 0,
6932
- _v$2: void 0
6935
+ _v$2: void 0,
6936
+ _v$3: void 0
6933
6937
  });
6934
6938
  return _el$;
6935
6939
  })();
6936
6940
  };
6937
- const _tmpl$$a = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path fill-rule="evenodd" clip-rule="evenodd" d="M7.86358 9.13637C7.51211 8.7849 7.51211 8.21505 7.86358 7.86358C8.21505 7.51211 8.7849 7.51211 9.13637 7.86358L12 10.7272L14.8636 7.86358C15.2151 7.51211 15.7849 7.51211 16.1364 7.86358C16.4878 8.21505 16.4878 8.7849 16.1364 9.13637L13.2728 12L16.1364 14.8636C16.4878 15.2151 16.4878 15.7849 16.1364 16.1364C15.7849 16.4878 15.2151 16.4878 14.8636 16.1364L12 13.2728L9.13637 16.1364C8.7849 16.4878 8.21505 16.4878 7.86358 16.1364C7.51211 15.7849 7.51211 15.2151 7.86358 14.8636L10.7272 12L7.86358 9.13637Z" fill="white"></path></svg>`);
6941
+ const _tmpl$$a = /* @__PURE__ */ template$1(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"></circle><path fill-rule="evenodd" clip-rule="evenodd" d="M7.86358 9.13637C7.51211 8.7849 7.51211 8.21505 7.86358 7.86358C8.21505 7.51211 8.7849 7.51211 9.13637 7.86358L12 10.7272L14.8636 7.86358C15.2151 7.51211 15.7849 7.51211 16.1364 7.86358C16.4878 8.21505 16.4878 8.7849 16.1364 9.13637L13.2728 12L16.1364 14.8636C16.4878 15.2151 16.4878 15.7849 16.1364 16.1364C15.7849 16.4878 15.2151 16.4878 14.8636 16.1364L12 13.2728L9.13637 16.1364C8.7849 16.4878 8.21505 16.4878 7.86358 16.1364C7.51211 15.7849 7.51211 15.2151 7.86358 14.8636L10.7272 12L7.86358 9.13637Z"></path></svg>`);
6938
6942
  const ErrorIcon = (props) => {
6939
6943
  const theme = useTheme();
6940
6944
  const fill = () => props.fill || theme.colors.icon.secondary;
6941
6945
  return (() => {
6942
- const _el$ = _tmpl$$a.cloneNode(true), _el$2 = _el$.firstChild;
6946
+ const _el$ = _tmpl$$a.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
6943
6947
  createRenderEffect((_p$) => {
6944
- const _v$ = props.class, _v$2 = fill();
6948
+ const _v$ = props.class, _v$2 = fill(), _v$3 = theme.colors.constant.white;
6945
6949
  _v$ !== _p$._v$ && setAttribute(_el$, "class", _p$._v$ = _v$);
6946
6950
  _v$2 !== _p$._v$2 && setAttribute(_el$2, "fill", _p$._v$2 = _v$2);
6951
+ _v$3 !== _p$._v$3 && setAttribute(_el$3, "fill", _p$._v$3 = _v$3);
6947
6952
  return _p$;
6948
6953
  }, {
6949
6954
  _v$: void 0,
6950
- _v$2: void 0
6955
+ _v$2: void 0,
6956
+ _v$3: void 0
6951
6957
  });
6952
6958
  return _el$;
6953
6959
  })();
@@ -7223,7 +7229,7 @@ var __async = (__this, __arguments, generator) => {
7223
7229
  }
7224
7230
  });
7225
7231
  };
7226
- const LoaderIconStyled$2 = styled(LoaderIcon)`
7232
+ const LoaderIconStyled$3 = styled(LoaderIcon)`
7227
7233
  align-self: center;
7228
7234
  min-width: 22px;
7229
7235
  min-height: 22px;
@@ -7237,7 +7243,7 @@ var __async = (__this, __arguments, generator) => {
7237
7243
  return props.class;
7238
7244
  },
7239
7245
  get icon() {
7240
- return createComponent(LoaderIconStyled$2, {});
7246
+ return createComponent(LoaderIconStyled$3, {});
7241
7247
  },
7242
7248
  children: "Confirm operation in your wallet"
7243
7249
  });
@@ -7402,7 +7408,25 @@ var __async = (__this, __arguments, generator) => {
7402
7408
  }
7403
7409
  `;
7404
7410
  const DropdownButtonStyled = styled(AccountButtonStyled)`
7411
+ width: 140px;
7412
+ gap: 11px;
7413
+ justify-content: center;
7405
7414
  background-color: ${(props) => props.theme.colors.background.primary};
7415
+ `;
7416
+ const LoaderButtonStyled = styled(Button)`
7417
+ width: 140px;
7418
+
7419
+ background-color: ${(props) => props.theme.colors.background.primary};
7420
+ color: ${(props) => props.theme.colors.connectButton.foreground};
7421
+ box-shadow: ${(props) => `0 4px 24px ${rgba(props.theme.colors.constant.black, 0.16)}`};
7422
+
7423
+ display: flex;
7424
+ align-items: center;
7425
+ justify-content: center;
7426
+ `;
7427
+ const LoaderIconStyled$2 = styled(LoaderIcon)`
7428
+ height: 18px;
7429
+ width: 18px;
7406
7430
  `;
7407
7431
  const DropdownContainerStyled = styled.div`
7408
7432
  display: flex;
@@ -8170,6 +8194,7 @@ var __async = (__this, __arguments, generator) => {
8170
8194
  const tonConnectUI = useContext(TonConnectUiContext);
8171
8195
  const [isOpened, setIsOpened] = createSignal(false);
8172
8196
  const [account, setAccount] = createSignal(null);
8197
+ const [restoringProcess, setRestoringProcess] = createSignal(true);
8173
8198
  let dropDownRef;
8174
8199
  const [floating, setFloating] = createSignal();
8175
8200
  const [anchor, setAnchor] = createSignal();
@@ -8185,6 +8210,7 @@ var __async = (__this, __arguments, generator) => {
8185
8210
  }
8186
8211
  return "";
8187
8212
  };
8213
+ tonConnectUI.connectionRestored.then(() => setRestoringProcess(false));
8188
8214
  const unsubscribe = connector.onStatusChange((wallet) => {
8189
8215
  if (!wallet) {
8190
8216
  setIsOpened(false);
@@ -8212,123 +8238,144 @@ var __async = (__this, __arguments, generator) => {
8212
8238
  });
8213
8239
  return [createComponent(Show, {
8214
8240
  get when() {
8215
- return !account();
8241
+ return restoringProcess();
8216
8242
  },
8217
8243
  get children() {
8218
- return createComponent(AccountButtonStyled, {
8219
- onClick: () => tonConnectUI.connectWallet(),
8220
- id: "tc-connect-button",
8244
+ return createComponent(LoaderButtonStyled, {
8245
+ disabled: true,
8246
+ id: "tc-connect-button-loading",
8221
8247
  get children() {
8222
- return [createComponent(TonIcon, {
8223
- get fill() {
8224
- return theme.colors.connectButton.foreground;
8225
- }
8226
- }), createComponent(Text, {
8227
- translationKey: "button.connectWallet",
8228
- fontSize: "15px",
8229
- letterSpacing: "-0.24px",
8230
- fontWeight: "590",
8231
- get color() {
8232
- return theme.colors.connectButton.foreground;
8233
- },
8234
- children: "Connect wallet"
8235
- })];
8248
+ return createComponent(LoaderIconStyled$2, {});
8236
8249
  }
8237
8250
  });
8238
8251
  }
8239
8252
  }), createComponent(Show, {
8240
8253
  get when() {
8241
- return account();
8254
+ return !restoringProcess();
8242
8255
  },
8243
8256
  get children() {
8244
- return createComponent(DropdownContainerStyled, {
8257
+ return [createComponent(Show, {
8258
+ get when() {
8259
+ return !account();
8260
+ },
8245
8261
  get children() {
8246
- return [createComponent(DropdownButtonStyled, {
8247
- onClick: () => setIsOpened((v) => !v),
8248
- ref: setAnchor,
8249
- id: "tc-dropdown-button",
8262
+ return createComponent(AccountButtonStyled, {
8263
+ onClick: () => tonConnectUI.connectWallet(),
8264
+ id: "tc-connect-button",
8250
8265
  get children() {
8251
- return [createComponent(Text, {
8266
+ return [createComponent(TonIcon, {
8267
+ get fill() {
8268
+ return theme.colors.connectButton.foreground;
8269
+ }
8270
+ }), createComponent(Text, {
8271
+ translationKey: "button.connectWallet",
8252
8272
  fontSize: "15px",
8253
8273
  letterSpacing: "-0.24px",
8254
8274
  fontWeight: "590",
8255
- get children() {
8256
- return normalizedAddress();
8257
- }
8258
- }), createComponent(ArrowIcon, {
8259
- direction: "bottom"
8275
+ get color() {
8276
+ return theme.colors.connectButton.foreground;
8277
+ },
8278
+ children: "Connect wallet"
8260
8279
  })];
8261
8280
  }
8262
- }), createComponent(Portal, {
8281
+ });
8282
+ }
8283
+ }), createComponent(Show, {
8284
+ get when() {
8285
+ return account();
8286
+ },
8287
+ get children() {
8288
+ return createComponent(DropdownContainerStyled, {
8263
8289
  get children() {
8264
- const _el$ = _tmpl$$3.cloneNode(true);
8265
- use(setFloating, _el$);
8266
- _el$.style.setProperty("z-index", "999");
8267
- insert(_el$, createComponent(Transition, {
8268
- onBeforeEnter: (el) => {
8269
- el.animate([{
8270
- opacity: 0,
8271
- transform: "translateY(-8px)"
8272
- }, {
8273
- opacity: 1,
8274
- transform: "translateY(0)"
8275
- }], {
8276
- duration: 150
8277
- });
8278
- },
8279
- onExit: (el, done) => {
8280
- const a2 = el.animate([{
8281
- opacity: 1,
8282
- transform: "translateY(0)"
8283
- }, {
8284
- opacity: 0,
8285
- transform: "translateY(-8px)"
8286
- }], {
8287
- duration: 150
8288
- });
8289
- a2.finished.then(done);
8290
- },
8290
+ return [createComponent(DropdownButtonStyled, {
8291
+ onClick: () => setIsOpened((v) => !v),
8292
+ ref: setAnchor,
8293
+ id: "tc-dropdown-button",
8291
8294
  get children() {
8292
- return createComponent(Show, {
8293
- get when() {
8294
- return isOpened();
8295
+ return [createComponent(Text, {
8296
+ fontSize: "15px",
8297
+ letterSpacing: "-0.24px",
8298
+ fontWeight: "590",
8299
+ lineHeight: "18px",
8300
+ get children() {
8301
+ return normalizedAddress();
8302
+ }
8303
+ }), createComponent(ArrowIcon, {
8304
+ direction: "bottom"
8305
+ })];
8306
+ }
8307
+ }), createComponent(Portal, {
8308
+ get children() {
8309
+ const _el$ = _tmpl$$3.cloneNode(true);
8310
+ use(setFloating, _el$);
8311
+ _el$.style.setProperty("z-index", "999");
8312
+ insert(_el$, createComponent(Transition, {
8313
+ onBeforeEnter: (el) => {
8314
+ el.animate([{
8315
+ opacity: 0,
8316
+ transform: "translateY(-8px)"
8317
+ }, {
8318
+ opacity: 1,
8319
+ transform: "translateY(0)"
8320
+ }], {
8321
+ duration: 150
8322
+ });
8323
+ },
8324
+ onExit: (el, done) => {
8325
+ const a2 = el.animate([{
8326
+ opacity: 1,
8327
+ transform: "translateY(0)"
8328
+ }, {
8329
+ opacity: 0,
8330
+ transform: "translateY(-8px)"
8331
+ }], {
8332
+ duration: 150
8333
+ });
8334
+ a2.finished.then(done);
8295
8335
  },
8296
8336
  get children() {
8297
- return createComponent(DropdownStyled, {
8298
- get hidden() {
8299
- return !isOpened();
8300
- },
8301
- onClose: () => setIsOpened(false),
8302
- ref(r$) {
8303
- const _ref$ = dropDownRef;
8304
- typeof _ref$ === "function" ? _ref$(r$) : dropDownRef = r$;
8337
+ return createComponent(Show, {
8338
+ get when() {
8339
+ return isOpened();
8305
8340
  },
8306
- id: "tc-dropdown"
8341
+ get children() {
8342
+ return createComponent(DropdownStyled, {
8343
+ get hidden() {
8344
+ return !isOpened();
8345
+ },
8346
+ onClose: () => setIsOpened(false),
8347
+ ref(r$) {
8348
+ const _ref$ = dropDownRef;
8349
+ typeof _ref$ === "function" ? _ref$(r$) : dropDownRef = r$;
8350
+ },
8351
+ id: "tc-dropdown"
8352
+ });
8353
+ }
8307
8354
  });
8308
8355
  }
8356
+ }), null);
8357
+ insert(_el$, createComponent(NotificationsStyled, {
8358
+ id: "tc-notifications"
8359
+ }), null);
8360
+ createRenderEffect((_p$) => {
8361
+ var _a2, _b;
8362
+ const _v$ = position.strategy, _v$2 = `${(_a2 = position.y) != null ? _a2 : 0}px`, _v$3 = `${(_b = position.x) != null ? _b : 0}px`;
8363
+ _v$ !== _p$._v$ && _el$.style.setProperty("position", _p$._v$ = _v$);
8364
+ _v$2 !== _p$._v$2 && _el$.style.setProperty("top", _p$._v$2 = _v$2);
8365
+ _v$3 !== _p$._v$3 && _el$.style.setProperty("left", _p$._v$3 = _v$3);
8366
+ return _p$;
8367
+ }, {
8368
+ _v$: void 0,
8369
+ _v$2: void 0,
8370
+ _v$3: void 0
8309
8371
  });
8372
+ return _el$;
8310
8373
  }
8311
- }), null);
8312
- insert(_el$, createComponent(NotificationsStyled, {
8313
- id: "tc-notifications"
8314
- }), null);
8315
- createRenderEffect((_p$) => {
8316
- var _a2, _b;
8317
- const _v$ = position.strategy, _v$2 = `${(_a2 = position.y) != null ? _a2 : 0}px`, _v$3 = `${(_b = position.x) != null ? _b : 0}px`;
8318
- _v$ !== _p$._v$ && _el$.style.setProperty("position", _p$._v$ = _v$);
8319
- _v$2 !== _p$._v$2 && _el$.style.setProperty("top", _p$._v$2 = _v$2);
8320
- _v$3 !== _p$._v$3 && _el$.style.setProperty("left", _p$._v$3 = _v$3);
8321
- return _p$;
8322
- }, {
8323
- _v$: void 0,
8324
- _v$2: void 0,
8325
- _v$3: void 0
8326
- });
8327
- return _el$;
8374
+ })];
8328
8375
  }
8329
- })];
8376
+ });
8330
8377
  }
8331
- });
8378
+ })];
8332
8379
  }
8333
8380
  })];
8334
8381
  };
@@ -10161,7 +10208,12 @@ var __async = (__this, __arguments, generator) => {
10161
10208
  }), createComponent(ButtonsContainerStyled, {
10162
10209
  get children() {
10163
10210
  return [createComponent(ActionButtonStyled, {
10164
- onClick: () => openLink(universalLink),
10211
+ onClick: () => {
10212
+ setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, props.wallet), {
10213
+ openMethod: "universal-link"
10214
+ }));
10215
+ openLink(universalLink);
10216
+ },
10165
10217
  get children() {
10166
10218
  return createComponent(Translation, {
10167
10219
  translationKey: "walletModal.qrCodeModal.openWallet",
@@ -10181,9 +10233,12 @@ var __async = (__this, __arguments, generator) => {
10181
10233
  },
10182
10234
  get children() {
10183
10235
  return createComponent(ActionButtonStyled, {
10184
- onClick: () => connector.connect({
10185
- jsBridgeKey: props.wallet.jsBridgeKey
10186
- }, props.additionalRequest),
10236
+ onClick: () => {
10237
+ setLastSelectedWalletInfo(props.wallet);
10238
+ connector.connect({
10239
+ jsBridgeKey: props.wallet.jsBridgeKey
10240
+ }, props.additionalRequest);
10241
+ },
10187
10242
  get children() {
10188
10243
  return createComponent(Translation, {
10189
10244
  translationKey: "walletModal.qrCodeModal.openExtension",
@@ -10488,14 +10543,20 @@ var __async = (__this, __arguments, generator) => {
10488
10543
  setSelectedWalletInfo(null);
10489
10544
  };
10490
10545
  const onSelect = (walletInfo) => {
10491
- setLastSelectedWalletInfo(walletInfo);
10492
10546
  if (isDevice("mobile") && "universalLink" in walletInfo) {
10547
+ setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, walletInfo), {
10548
+ openMethod: "universal-link"
10549
+ }));
10493
10550
  return onSelectIfMobile(walletInfo);
10494
10551
  }
10495
10552
  if (isWalletInfoInjected(walletInfo) && walletInfo.injected) {
10553
+ setLastSelectedWalletInfo(walletInfo);
10496
10554
  return onSelectIfInjected(walletInfo);
10497
10555
  }
10498
10556
  if ("bridgeUrl" in walletInfo) {
10557
+ setLastSelectedWalletInfo(__spreadProps(__spreadValues({}, walletInfo), {
10558
+ openMethod: "qrcode"
10559
+ }));
10499
10560
  setSelectedWalletInfo(walletInfo);
10500
10561
  return;
10501
10562
  }
@@ -10826,6 +10887,7 @@ var __async = (__this, __arguments, generator) => {
10826
10887
  __publicField(this, "_walletInfo", null);
10827
10888
  __publicField(this, "systemThemeChangeUnsubscribe", null);
10828
10889
  __publicField(this, "actionsConfiguration");
10890
+ __publicField(this, "connectionRestored", Promise.resolve(false));
10829
10891
  if (options && "connector" in options && options.connector) {
10830
10892
  this.connector = options.connector;
10831
10893
  } else if (options && "manifestUrl" in options && options.manifestUrl) {
@@ -10842,11 +10904,13 @@ var __async = (__this, __arguments, generator) => {
10842
10904
  const rootId = this.normalizeWidgetRoot(options == null ? void 0 : options.widgetRootId);
10843
10905
  this.subscribeToWalletChange();
10844
10906
  if ((options == null ? void 0 : options.restoreConnection) !== false) {
10845
- this.connector.restoreConnection().then(() => {
10907
+ this.connectionRestored = new Promise((resolve) => __async(this, null, function* () {
10908
+ yield this.connector.restoreConnection();
10846
10909
  if (!this.connector.connected) {
10847
10910
  this.walletInfoStorage.removeWalletInfo();
10848
10911
  }
10849
- });
10912
+ resolve(this.connector.connected);
10913
+ }));
10850
10914
  }
10851
10915
  this.uiOptions = mergeOptions(options, { uiPreferences: { theme: "SYSTEM" } });
10852
10916
  setAppState({
@@ -10952,7 +11016,7 @@ var __async = (__this, __arguments, generator) => {
10952
11016
  if (!this.connected || !this.walletInfo) {
10953
11017
  throw new TonConnectUIError("Connect wallet to send a transaction.");
10954
11018
  }
10955
- if (!isDevice("desktop") && "universalLink" in this.walletInfo) {
11019
+ if ("universalLink" in this.walletInfo && this.walletInfo.openMethod === "universal-link") {
10956
11020
  openLink(this.walletInfo.universalLink);
10957
11021
  }
10958
11022
  const { notifications: notifications2, modals } = this.getModalsAndNotificationsConfiguration(options);