tek-wallet 0.0.771 → 0.0.773
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.
- package/dist/components/TekWallet/components/ui/RequireConnect/index.js +1 -1
- package/dist/components/TekWallet/components/views/ChangePasscodeView/index.js +8 -3
- package/dist/components/TekWallet/components/views/ChangePasscodeView/type.d.ts +2 -1
- package/dist/components/TekWallet/components/views/ChangePasscodeView/type.js +1 -0
- package/package.json +1 -1
|
@@ -95,7 +95,7 @@ function RequireConnect(_a) {
|
|
|
95
95
|
display: "block",
|
|
96
96
|
}, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}) }), (0, jsx_runtime_1.jsx)(DrawerComponent_1.default, { ref: initPasscodeRef, direction: DrawerComponent_1.DRAWER_DIRECTION.RIGHT, sx: {
|
|
97
97
|
display: "block",
|
|
98
|
-
}, children: (0, jsx_runtime_1.jsx)(material_1.Box, { onClick: stopPropagation, children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { isInitPasscode: true, onBack: handleBackInitPasscodeView, idPrefix: idPrefix }) }) })] }));
|
|
98
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.Box, { onClick: stopPropagation, sx: { width: "100%", height: "100%" }, children: (0, jsx_runtime_1.jsx)(ChangePasscodeView_1.default, { isInitPasscode: true, onBack: handleBackInitPasscodeView, idPrefix: idPrefix }) }) })] }));
|
|
99
99
|
}
|
|
100
100
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
101
101
|
}
|
|
@@ -208,6 +208,11 @@ var ChangePasscodeView = function (props) {
|
|
|
208
208
|
* validate otp here
|
|
209
209
|
*/
|
|
210
210
|
if (value.length === passcodeLength) {
|
|
211
|
+
if (value === oldPasscode) {
|
|
212
|
+
setError(type_1.ChangePasscodeError.PASSCODE_SAME_AS_OLD);
|
|
213
|
+
setNewPasscode("");
|
|
214
|
+
return [2 /*return*/];
|
|
215
|
+
}
|
|
211
216
|
gotoStep(type_1.ChangePasscodeViewStep.CONFIRM_NEW_PASSCODE);
|
|
212
217
|
}
|
|
213
218
|
return [2 /*return*/];
|
|
@@ -328,21 +333,21 @@ var ChangePasscodeView = function (props) {
|
|
|
328
333
|
alignItems: "center",
|
|
329
334
|
gap: "1rem",
|
|
330
335
|
height: "100%",
|
|
331
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: oldPasscode, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), unknownError, warningContent, error && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "left" }), children: error })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
336
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: oldPasscode, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), unknownError, warningContent, !!error && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "left" }), children: error })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_OLD_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
332
337
|
display: "flex",
|
|
333
338
|
flexDirection: "column",
|
|
334
339
|
justifyContent: "center",
|
|
335
340
|
alignItems: "center",
|
|
336
341
|
height: "100%",
|
|
337
342
|
gap: "1rem",
|
|
338
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: newPasscode, onChange: handleNewPasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
343
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: newPasscode, onChange: handleNewPasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), !!error && ((0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign(__assign({}, theme.mixins.validationError), { alignSelf: "left" }), children: type_1.ChangePasscodeError.PASSCODE_SAME_AS_OLD })), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.ENTER_NEW_PASSCODE].description })] }) }), (0, jsx_runtime_1.jsx)(react_1.SwiperSlide, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
339
344
|
display: "flex",
|
|
340
345
|
flexDirection: "column",
|
|
341
346
|
alignItems: "center",
|
|
342
347
|
justifyContent: "center",
|
|
343
348
|
height: "100%",
|
|
344
349
|
gap: "1rem",
|
|
345
|
-
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.CONFIRM_NEW_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: confirmPasscode, onChange: handleConfirmPasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), error && (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: error }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.CONFIRM_NEW_PASSCODE].description })] }) })] }) }) }) }));
|
|
350
|
+
}, children: [(0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionTitle), children: stepsContent[type_1.ChangePasscodeViewStep.CONFIRM_NEW_PASSCODE].title }), (0, jsx_runtime_1.jsx)(xhub_keyboard_1.Label, { useBrowserInput: false, htmlFor: keyboardId, children: (0, jsx_runtime_1.jsx)(OTP_1.default, { value: confirmPasscode, onChange: handleConfirmPasscodeChange, numInputs: passcodeLength, otpInputType: OTP_1.OtpInputType.PASSWORD, readOnly: true }) }), !!error && (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.validationError), children: error }), (0, jsx_runtime_1.jsx)(Text_1.default, { sx: __assign({}, theme.mixins.sessionDescription), children: stepsContent[type_1.ChangePasscodeViewStep.CONFIRM_NEW_PASSCODE].description })] }) })] }) }) }) }));
|
|
346
351
|
};
|
|
347
352
|
exports.ChangePasscodeView = ChangePasscodeView;
|
|
348
353
|
exports.default = exports.ChangePasscodeView;
|
|
@@ -5,5 +5,6 @@ export declare enum ChangePasscodeViewStep {
|
|
|
5
5
|
}
|
|
6
6
|
export declare enum ChangePasscodeError {
|
|
7
7
|
OLD_PASSCODE_INCORRECT = "Old passcode is incorrect",
|
|
8
|
-
PASSCODE_NOT_MATCH = "The confirmation passcode does not match"
|
|
8
|
+
PASSCODE_NOT_MATCH = "The confirmation passcode does not match",
|
|
9
|
+
PASSCODE_SAME_AS_OLD = "New passcode is same as old passcode"
|
|
9
10
|
}
|
|
@@ -11,4 +11,5 @@ var ChangePasscodeError;
|
|
|
11
11
|
(function (ChangePasscodeError) {
|
|
12
12
|
ChangePasscodeError["OLD_PASSCODE_INCORRECT"] = "Old passcode is incorrect";
|
|
13
13
|
ChangePasscodeError["PASSCODE_NOT_MATCH"] = "The confirmation passcode does not match";
|
|
14
|
+
ChangePasscodeError["PASSCODE_SAME_AS_OLD"] = "New passcode is same as old passcode";
|
|
14
15
|
})(ChangePasscodeError || (exports.ChangePasscodeError = ChangePasscodeError = {}));
|