tek-wallet 0.0.789 → 0.0.790
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.
|
@@ -61,14 +61,17 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
61
61
|
var _a = (0, react_1.useState)(false), isOpen = _a[0], setIsOpen = _a[1];
|
|
62
62
|
var _b = (0, react_1.useState)(false), isReaderReady = _b[0], setIsReaderReady = _b[1];
|
|
63
63
|
var _c = (0, react_1.useState)(false), flashEnabled = _c[0], setFlashEnabled = _c[1];
|
|
64
|
+
var boxRef = (0, react_1.useRef)(null);
|
|
64
65
|
var open = function () {
|
|
65
|
-
var _a;
|
|
66
|
+
var _a, _b;
|
|
66
67
|
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.open();
|
|
68
|
+
(_b = boxRef.current) === null || _b === void 0 ? void 0 : _b.click();
|
|
67
69
|
setIsOpen(true);
|
|
68
70
|
};
|
|
69
71
|
var close = function () {
|
|
70
|
-
var _a;
|
|
72
|
+
var _a, _b;
|
|
71
73
|
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
74
|
+
(_b = boxRef.current) === null || _b === void 0 ? void 0 : _b.click();
|
|
72
75
|
setIsOpen(false);
|
|
73
76
|
};
|
|
74
77
|
var onOpen = function () {
|
|
@@ -125,14 +128,17 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
125
128
|
var theme = (0, providers_1.useTheme)();
|
|
126
129
|
var _d = (0, providers_1.useWalletSetup)(), topOffset = _d.topOffset, overrideQRScanMethod = _d.overrideQRScanMethod;
|
|
127
130
|
if (!!overrideQRScanMethod) {
|
|
128
|
-
var handleOverrideQRScanMethod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
131
|
+
var handleOverrideQRScanMethod = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
129
132
|
var result, fakeIDetectedBarcode, error_1;
|
|
130
133
|
return __generator(this, function (_a) {
|
|
131
134
|
switch (_a.label) {
|
|
132
135
|
case 0:
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
console.warn("🚀 ~ handleOverrideQRScanMethod ~ event:", event);
|
|
137
|
+
_a.label = 1;
|
|
135
138
|
case 1:
|
|
139
|
+
_a.trys.push([1, 3, , 4]);
|
|
140
|
+
return [4 /*yield*/, overrideQRScanMethod()];
|
|
141
|
+
case 2:
|
|
136
142
|
result = _a.sent();
|
|
137
143
|
if (!result) {
|
|
138
144
|
console.warn("🚀 ~ handleOverrideQRScanMethod ~ result:", result);
|
|
@@ -150,16 +156,16 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
150
156
|
cornerPoints: [],
|
|
151
157
|
};
|
|
152
158
|
onResult([fakeIDetectedBarcode]);
|
|
153
|
-
return [3 /*break*/,
|
|
154
|
-
case
|
|
159
|
+
return [3 /*break*/, 4];
|
|
160
|
+
case 3:
|
|
155
161
|
error_1 = _a.sent();
|
|
156
162
|
console.error(error_1);
|
|
157
|
-
return [3 /*break*/,
|
|
158
|
-
case
|
|
163
|
+
return [3 /*break*/, 4];
|
|
164
|
+
case 4: return [2 /*return*/];
|
|
159
165
|
}
|
|
160
166
|
});
|
|
161
167
|
}); };
|
|
162
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, className: className, onClick: handleOverrideQRScanMethod, children: children }));
|
|
168
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, className: className, onClick: handleOverrideQRScanMethod, ref: boxRef, children: children }));
|
|
163
169
|
}
|
|
164
170
|
return ((0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { trigger: children, ref: drawerRef, onDone: onClose, onOpen: onOpen, sx: sx, className: className, children: (0, jsx_runtime_1.jsx)(ChildPageLayout_1.default, { sx: {
|
|
165
171
|
backgroundColor: "transparent !important",
|