tek-wallet 0.0.414 → 0.0.416
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.
|
@@ -56,7 +56,7 @@ Button.Primary = function (props) {
|
|
|
56
56
|
color: theme.palette.text.white24,
|
|
57
57
|
},
|
|
58
58
|
_a);
|
|
59
|
-
return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", color: "primary", status: status, sx: __assign({ borderRadius: theme.mixins.theBorderRadius.full, "&.Mui-disabled": __assign({}, disabledStyles[status]) }, sx), children: [status === BUTTON_STATUS.LOADING && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 }), "Processing"] })), status === BUTTON_STATUS.ERROR && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Error" }), status === BUTTON_STATUS.ENABLED && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children })] })));
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)(Button, __assign({}, rest, { variant: "contained", color: "primary", status: status, sx: __assign({ borderRadius: theme.mixins.theBorderRadius.full, "&.Mui-disabled": __assign({}, disabledStyles[status]) }, sx), children: [status === BUTTON_STATUS.LOADING && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: __assign(__assign({}, theme.mixins.row), { gap: theme.mixins.gaps.g8 }), children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { color: "inherit", size: 20 }), "Processing"] })), status === BUTTON_STATUS.ERROR && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Error" }), status === BUTTON_STATUS.ENABLED && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }), status === BUTTON_STATUS.DISABLED && (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children })] })));
|
|
60
60
|
};
|
|
61
61
|
Button.Primary.displayName = "Button.Primary";
|
|
62
62
|
Button.Secondary = function (props) {
|
|
@@ -550,11 +550,12 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
550
550
|
});
|
|
551
551
|
}); };
|
|
552
552
|
var handleSendExternal = function (passcode) { return __awaiter(void 0, void 0, void 0, function () {
|
|
553
|
-
var response;
|
|
553
|
+
var response, err_1;
|
|
554
554
|
var _a, _b;
|
|
555
555
|
return __generator(this, function (_c) {
|
|
556
556
|
switch (_c.label) {
|
|
557
557
|
case 0:
|
|
558
|
+
_c.trys.push([0, 2, , 3]);
|
|
558
559
|
console.warn("withdraw external");
|
|
559
560
|
setSendButtonStatus(Button_1.BUTTON_STATUS.LOADING);
|
|
560
561
|
return [4 /*yield*/, (0, send_external_service_1.default)({
|
|
@@ -574,12 +575,18 @@ var WithdrawFunction = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
574
575
|
(_b = props.onSendSuccess) === null || _b === void 0 ? void 0 : _b.call(props, response);
|
|
575
576
|
}
|
|
576
577
|
else {
|
|
577
|
-
|
|
578
|
-
setTimeout(function () {
|
|
579
|
-
setSendButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
|
|
580
|
-
}, 1200);
|
|
578
|
+
throw new Error("Send external failed");
|
|
581
579
|
}
|
|
582
|
-
return [
|
|
580
|
+
return [3 /*break*/, 3];
|
|
581
|
+
case 2:
|
|
582
|
+
err_1 = _c.sent();
|
|
583
|
+
console.error(err_1);
|
|
584
|
+
setSendButtonStatus(Button_1.BUTTON_STATUS.ERROR);
|
|
585
|
+
setTimeout(function () {
|
|
586
|
+
setSendButtonStatus(Button_1.BUTTON_STATUS.ENABLED);
|
|
587
|
+
}, 1200);
|
|
588
|
+
return [3 /*break*/, 3];
|
|
589
|
+
case 3: return [2 /*return*/];
|
|
583
590
|
}
|
|
584
591
|
});
|
|
585
592
|
}); };
|