tek-wallet 0.0.351 → 0.0.352

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.
@@ -162,6 +162,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
162
162
  var _o = (0, react_1.useState)(), sendInfoGet = _o[0], setSendInfoGet = _o[1];
163
163
  var _p = (0, react_1.useState)(), recipientAddressError = _p[0], setRecipientAddressError = _p[1];
164
164
  var _q = (0, react_1.useState)(), recipientAddressInternal = _q[0], setRecipientAddressInternal = _q[1];
165
+ var onlyChangeAddress = (0, react_1.useRef)(false);
165
166
  var networks = (0, react_1.useMemo)(function () {
166
167
  console.warn("🚀 ~ networks ~ selectedToken:", selectedToken);
167
168
  if (!selectedToken) {
@@ -187,6 +188,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
187
188
  setAmountErrorMessage(undefined);
188
189
  setHiddenError(true);
189
190
  setRecipientAddressError(undefined);
191
+ onlyChangeAddress.current = false;
190
192
  };
191
193
  var handleClearRecipientAddress = function () {
192
194
  setRecipientAddress("");
@@ -271,8 +273,11 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
271
273
  (_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
272
274
  var tokenSet = findWithdrawToken((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.jetton) || "");
273
275
  console.warn("🚀 ~ handleSelectTransferInternal ~ sendInfoGet:", sendInfoGet);
274
- setSelectedMethod(SendMethods.TRANSFER_INTERNAL);
275
276
  setRecipientAddress(recipientAddressInternal);
277
+ setSelectedMethod(SendMethods.TRANSFER_INTERNAL);
278
+ if (!onlyChangeAddress.current) {
279
+ return;
280
+ }
276
281
  setAmount(getAmountAfterDecimal((sendInfoGet === null || sendInfoGet === void 0 ? void 0 : sendInfoGet.amount) || 0, (tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.decimal) || 0));
277
282
  if (!tokenSet) {
278
283
  gotoStep(WithdrawStep.SELECT_TOKEN);
@@ -288,6 +293,11 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
288
293
  console.warn("🚀 ~ data handleSelectContinueTransferExternal:", data);
289
294
  (_a = suggestUseTransferInternalDialogRef.current) === null || _a === void 0 ? void 0 : _a.close();
290
295
  var tokenSet = findWithdrawToken((data === null || data === void 0 ? void 0 : data.jetton) || "");
296
+ setSelectedMethod(SendMethods.TRANSFER_EXTERNAL);
297
+ setRecipientAddress(data === null || data === void 0 ? void 0 : data.address);
298
+ if (!onlyChangeAddress.current) {
299
+ return;
300
+ }
291
301
  if (!tokenSet) {
292
302
  gotoStep(WithdrawStep.SELECT_TOKEN);
293
303
  }
@@ -296,8 +306,6 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
296
306
  setSelectedNetwork(tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.network_data);
297
307
  gotoStep(WithdrawStep.CONFIRM);
298
308
  }
299
- setSelectedMethod(SendMethods.TRANSFER_EXTERNAL);
300
- setRecipientAddress(data === null || data === void 0 ? void 0 : data.address);
301
309
  setAmount(getAmountAfterDecimal((data === null || data === void 0 ? void 0 : data.amount) || 0, (tokenSet === null || tokenSet === void 0 ? void 0 : tokenSet.decimal) || 0));
302
310
  setMemo(data === null || data === void 0 ? void 0 : data.text);
303
311
  };
@@ -436,7 +444,13 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
436
444
  }
437
445
  });
438
446
  }); };
439
- var handleScanAddressQrCode = function () { };
447
+ var handleScanAddressQrCode = function (result) { return __awaiter(void 0, void 0, void 0, function () {
448
+ return __generator(this, function (_a) {
449
+ onlyChangeAddress.current = true;
450
+ handleScanAllQrCode(result);
451
+ return [2 /*return*/];
452
+ });
453
+ }); };
440
454
  (0, react_1.useEffect)(function () {
441
455
  if (isAuthenticated && !withdrawTokens) {
442
456
  console.warn("🚀 ~ updateWithdrawToken ~ isAuthenticated:", isAuthenticated);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.351",
3
+ "version": "0.0.352",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",