tek-wallet 0.0.789 → 0.0.791
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,9 +61,11 @@ 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 () {
|
|
@@ -125,14 +127,17 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
125
127
|
var theme = (0, providers_1.useTheme)();
|
|
126
128
|
var _d = (0, providers_1.useWalletSetup)(), topOffset = _d.topOffset, overrideQRScanMethod = _d.overrideQRScanMethod;
|
|
127
129
|
if (!!overrideQRScanMethod) {
|
|
128
|
-
var handleOverrideQRScanMethod = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
130
|
+
var handleOverrideQRScanMethod = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
129
131
|
var result, fakeIDetectedBarcode, error_1;
|
|
130
132
|
return __generator(this, function (_a) {
|
|
131
133
|
switch (_a.label) {
|
|
132
134
|
case 0:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
console.warn("🚀 ~ handleOverrideQRScanMethod ~ event:", event);
|
|
136
|
+
_a.label = 1;
|
|
135
137
|
case 1:
|
|
138
|
+
_a.trys.push([1, 3, , 4]);
|
|
139
|
+
return [4 /*yield*/, overrideQRScanMethod()];
|
|
140
|
+
case 2:
|
|
136
141
|
result = _a.sent();
|
|
137
142
|
if (!result) {
|
|
138
143
|
console.warn("🚀 ~ handleOverrideQRScanMethod ~ result:", result);
|
|
@@ -150,16 +155,16 @@ var QrCodeReader = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
150
155
|
cornerPoints: [],
|
|
151
156
|
};
|
|
152
157
|
onResult([fakeIDetectedBarcode]);
|
|
153
|
-
return [3 /*break*/,
|
|
154
|
-
case
|
|
158
|
+
return [3 /*break*/, 4];
|
|
159
|
+
case 3:
|
|
155
160
|
error_1 = _a.sent();
|
|
156
161
|
console.error(error_1);
|
|
157
|
-
return [3 /*break*/,
|
|
158
|
-
case
|
|
162
|
+
return [3 /*break*/, 4];
|
|
163
|
+
case 4: return [2 /*return*/];
|
|
159
164
|
}
|
|
160
165
|
});
|
|
161
166
|
}); };
|
|
162
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, className: className, onClick: handleOverrideQRScanMethod, children: children }));
|
|
167
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: sx, className: className, onClick: handleOverrideQRScanMethod, ref: boxRef, children: children }));
|
|
163
168
|
}
|
|
164
169
|
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
170
|
backgroundColor: "transparent !important",
|