tek-wallet 0.0.325 → 0.0.327

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.
@@ -139,6 +139,14 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
139
139
  }
140
140
  return newNetWorks;
141
141
  }, [selectedToken, selectedNetwork]);
142
+ var gotoStep = function (step) {
143
+ var _a;
144
+ if (step === WithdrawStep.SELECT_METHOD) {
145
+ clearValues();
146
+ }
147
+ setCurrentStep(step);
148
+ (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(step);
149
+ };
142
150
  var clearValues = function () {
143
151
  setSelectedToken(undefined);
144
152
  setSelectedNetwork(undefined);
@@ -148,7 +156,6 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
148
156
  setSelectedMethod(undefined);
149
157
  setSendInfoGet(undefined);
150
158
  setRecipientAddressInternal(undefined);
151
- setCurrentStep(WithdrawStep.SELECT_METHOD);
152
159
  setAmountError(undefined);
153
160
  setAmountErrorMessage(undefined);
154
161
  };
@@ -159,7 +166,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
159
166
  var close = function () {
160
167
  var _a;
161
168
  (_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
162
- clearValues();
169
+ gotoStep(WithdrawStep.SELECT_METHOD);
163
170
  };
164
171
  (0, react_1.useImperativeHandle)(ref, function () { return ({
165
172
  open: open,
@@ -206,20 +213,12 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
206
213
  var balance = Math.min(+(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.balance), +(selectedToken === null || selectedToken === void 0 ? void 0 : selectedToken.max_value));
207
214
  setAmount(balance.toString() || "");
208
215
  };
209
- var gotoStep = function (step) {
210
- var _a;
211
- if (step === WithdrawStep.SELECT_METHOD) {
212
- clearValues();
213
- }
214
- setCurrentStep(step);
215
- (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.slideTo(step);
216
- };
217
216
  var handleReSelectNetwork = function () {
218
217
  gotoStep(WithdrawStep.SELECT_NETWORK);
219
218
  };
220
219
  var handleOnClose = function (e) {
221
220
  var _a;
222
- clearValues();
221
+ gotoStep(WithdrawStep.SELECT_METHOD);
223
222
  (_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);
224
223
  };
225
224
  var findWithdrawToken = function (contract_address) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.325",
3
+ "version": "0.0.327",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",