tek-wallet 0.0.450 → 0.0.451

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.
@@ -22,6 +22,7 @@ var EmptyData_1 = __importDefault(require("../EmptyData"));
22
22
  var ActivityItem_1 = __importDefault(require("../ActivityItem"));
23
23
  var useActivities_1 = __importDefault(require("../../../hooks/useActivities"));
24
24
  var react_1 = require("react");
25
+ var WaitingData_1 = __importDefault(require("../WaitingData"));
25
26
  var Status;
26
27
  (function (Status) {
27
28
  Status["Loading"] = "loading";
@@ -52,14 +53,13 @@ function ActivitiesTypeSlice(props) {
52
53
  !!activitiesByType ||
53
54
  isLoadingActivities[type.slug])
54
55
  return;
55
- console.warn("🚀 ~ useEffect ~ type:", type, activitiesByType);
56
56
  updateActivities({
57
57
  transaction_types: type.slug,
58
58
  page: 1,
59
59
  take: 10,
60
60
  });
61
61
  }, [isActive, type, activitiesByType, updateActivities]);
62
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { width: "100%", height: "100%", display: "flex" }, children: [status === Status.Empty && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { margin: "auto" }, icon: (0, getIcon_1.default)(prefix + "empty_" + type.slug), description: "No ".concat((_a = type.name) === null || _a === void 0 ? void 0 : _a.toLowerCase(), " activity") })), status === Status.Filled && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, paddingTop: theme.mixins.customPadding.p16 }), children: activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.map(function (activity, index) {
62
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { width: "100%", height: "100%", display: "flex" }, children: [status === Status.Loading && (0, jsx_runtime_1.jsx)(WaitingData_1.default, {}), status === Status.Empty && ((0, jsx_runtime_1.jsx)(EmptyData_1.default, { sx: { margin: "auto" }, icon: (0, getIcon_1.default)(prefix + "empty_" + type.slug), description: "No ".concat((_a = type.name) === null || _a === void 0 ? void 0 : _a.toLowerCase(), " activity") })), status === Status.Filled && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.column), { gap: theme.mixins.gaps.g12, paddingTop: theme.mixins.customPadding.p16 }), children: activitiesByType === null || activitiesByType === void 0 ? void 0 : activitiesByType.map(function (activity, index) {
63
63
  if (!activity)
64
64
  return null;
65
65
  var dataAsJson = JSON.stringify(activity);
@@ -30,7 +30,10 @@ var LoadingLayout = (0, react_1.forwardRef)(function (props, ref) {
30
30
  setLoading(false);
31
31
  },
32
32
  }); });
33
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.whiteLoadingOverlay), theme.mixins.row), { gap: theme.mixins.gaps.g8, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 20 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.center), { fontSize: theme.typography.fontSize12, color: "text.secondary" }), children: loadingMessage })] }))] }));
33
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign({ position: "relative", width: "fit-content", height: "fit-content" }, sx), children: [children, loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign(__assign({}, theme.mixins.whiteLoadingOverlay), theme.mixins.row), { gap: theme.mixins.gaps.g8, justifyContent: "center" }), children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "secondary", size: 20 }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: {
34
+ fontSize: theme.typography.fontSize12,
35
+ color: "text.secondary",
36
+ }, children: loadingMessage })] }))] }));
34
37
  });
35
38
  LoadingLayout.displayName = "LoadingLayout";
36
39
  exports.default = LoadingLayout;
@@ -108,7 +108,7 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
108
108
  var _f = (0, react_1.useState)(0), inputAmount = _f[0], setInputAmount = _f[1];
109
109
  var _g = (0, react_1.useState)(0), amount = _g[0], setAmount = _g[1];
110
110
  var _h = (0, react_1.useState)(""), amountError = _h[0], setAmountError = _h[1];
111
- var _j = (0, useReceiveData_1.default)(), receiveExternalTokens = _j.receiveExternalTokens, updateReceiveExternalToken = _j.updateReceiveExternalToken, receiveInternalTokens = _j.receiveInternalTokens, updateReceiveInternalToken = _j.updateReceiveInternalToken;
111
+ var _j = (0, useReceiveData_1.default)(), receiveExternalTokens = _j.receiveExternalTokens, updateReceiveExternalToken = _j.updateReceiveExternalToken, isLoadingReceiveExternalToken = _j.isLoadingReceiveExternalToken, isLoadingReceiveInternalToken = _j.isLoadingReceiveInternalToken, receiveInternalTokens = _j.receiveInternalTokens, updateReceiveInternalToken = _j.updateReceiveInternalToken;
112
112
  var receiveTokens = (0, react_1.useMemo)(function () {
113
113
  if (selectedMethod === ReceiveMethods.RECEIVE_INTERNAL) {
114
114
  return receiveInternalTokens;
@@ -283,10 +283,12 @@ var ReceiveFunction = (0, react_1.forwardRef)(function (props, ref) {
283
283
  gotoStep(ReceiveStep.SELECT_METHOD);
284
284
  };
285
285
  (0, react_1.useEffect)(function () {
286
- if (isAuthenticated && !receiveTokens) {
286
+ if (isAuthenticated && !receiveTokens && !isLoadingReceiveExternalToken) {
287
287
  updateReceiveExternalToken();
288
288
  }
289
- if (isAuthenticated && !receiveInternalTokens) {
289
+ if (isAuthenticated &&
290
+ !receiveInternalTokens &&
291
+ !isLoadingReceiveInternalToken) {
290
292
  updateReceiveInternalToken();
291
293
  }
292
294
  }, [isAuthenticated]);
@@ -160,7 +160,7 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
160
160
  var _d = (0, react_1.useState)(), selectedToken = _d[0], setSelectedToken = _d[1];
161
161
  var _e = (0, react_1.useState)(), selectedNetwork = _e[0], setSelectedNetwork = _e[1];
162
162
  var isAuthenticated = (0, useWalletData_1.default)().isAuthenticated;
163
- var _f = (0, useWithdrawData_1.default)(), withdrawTokens = _f.withdrawTokens, updateWithdrawToken = _f.updateWithdrawToken, updateSendInternalToken = _f.updateSendInternalToken, sendInternalTokens = _f.sendInternalTokens;
163
+ var _f = (0, useWithdrawData_1.default)(), withdrawTokens = _f.withdrawTokens, updateWithdrawToken = _f.updateWithdrawToken, updateSendInternalToken = _f.updateSendInternalToken, sendInternalTokens = _f.sendInternalTokens, isLoadingWithdrawToken = _f.isLoadingWithdrawToken, isLoadingSendInternalToken = _f.isLoadingSendInternalToken;
164
164
  var _g = (0, react_1.useState)(), infoDialogContent = _g[0], setInfoDialogContent = _g[1];
165
165
  var _h = (0, react_1.useState)(""), amount = _h[0], setAmount = _h[1];
166
166
  var _j = (0, react_1.useState)(undefined), memo = _j[0], setMemo = _j[1];
@@ -612,10 +612,10 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
612
612
  }
613
613
  };
614
614
  (0, react_1.useEffect)(function () {
615
- if (isAuthenticated && !withdrawToken) {
615
+ if (isAuthenticated && !withdrawToken && !isLoadingWithdrawToken) {
616
616
  updateWithdrawToken();
617
617
  }
618
- if (isAuthenticated && !withdrawToken) {
618
+ if (isAuthenticated && !withdrawToken && !isLoadingSendInternalToken) {
619
619
  updateSendInternalToken();
620
620
  }
621
621
  }, [isAuthenticated]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tek-wallet",
3
- "version": "0.0.450",
3
+ "version": "0.0.451",
4
4
  "description": "A custom React provider with TypeScript support",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",