@movalib/movalib-commons 1.1.69 → 1.1.70
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.
|
@@ -4,7 +4,7 @@ interface AccountValidationProps {
|
|
|
4
4
|
movaAppType: MovaAppType;
|
|
5
5
|
smsValidation: boolean;
|
|
6
6
|
onSubmit: (success: boolean, message: string) => void;
|
|
7
|
-
onResendSecurityCode
|
|
7
|
+
onResendSecurityCode?: (success: boolean, message: string) => void;
|
|
8
8
|
}
|
|
9
9
|
declare const AccountValidation: FunctionComponent<AccountValidationProps>;
|
|
10
10
|
export default AccountValidation;
|
|
@@ -166,7 +166,7 @@ var AccountValidation = function (_a) {
|
|
|
166
166
|
};
|
|
167
167
|
var resendCode = function () {
|
|
168
168
|
var _a;
|
|
169
|
-
if (controlPhoneNumber()) {
|
|
169
|
+
if (controlPhoneNumber() && onResendSecurityCode) {
|
|
170
170
|
var req = {
|
|
171
171
|
phoneNumber: (_a = validationForm.phoneNumber) === null || _a === void 0 ? void 0 : _a.value
|
|
172
172
|
};
|
|
@@ -175,16 +175,12 @@ var AccountValidation = function (_a) {
|
|
|
175
175
|
var _a, _b;
|
|
176
176
|
Logger_1.default.info(response);
|
|
177
177
|
if (response.success) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
onResendSecurityCode(response.success, (_a = response.data) !== null && _a !== void 0 ? _a : '');
|
|
182
|
-
}
|
|
178
|
+
// Fermeture boite de dialogue
|
|
179
|
+
setOpenPhoneNumberInput(false);
|
|
180
|
+
onResendSecurityCode(response.success, (_a = response.data) !== null && _a !== void 0 ? _a : '');
|
|
183
181
|
}
|
|
184
182
|
else {
|
|
185
|
-
|
|
186
|
-
onResendSecurityCode(response.success, (_b = response.error) !== null && _b !== void 0 ? _b : '');
|
|
187
|
-
}
|
|
183
|
+
onResendSecurityCode(response.success, (_b = response.error) !== null && _b !== void 0 ? _b : '');
|
|
188
184
|
}
|
|
189
185
|
}).catch(function (error) {
|
|
190
186
|
Logger_1.default.error(error);
|
package/package.json
CHANGED
|
@@ -28,7 +28,7 @@ interface AccountValidationProps {
|
|
|
28
28
|
movaAppType: MovaAppType,
|
|
29
29
|
smsValidation: boolean,
|
|
30
30
|
onSubmit: (success:boolean, message:string) => void,
|
|
31
|
-
onResendSecurityCode
|
|
31
|
+
onResendSecurityCode?: (success:boolean, message:string) => void,
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppType, smsValidation, onSubmit, onResendSecurityCode }) => {
|
|
@@ -195,7 +195,7 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
|
|
|
195
195
|
|
|
196
196
|
const resendCode = () => {
|
|
197
197
|
|
|
198
|
-
if(controlPhoneNumber()){
|
|
198
|
+
if(controlPhoneNumber() && onResendSecurityCode){
|
|
199
199
|
|
|
200
200
|
let req = {
|
|
201
201
|
phoneNumber : validationForm.phoneNumber?.value
|
|
@@ -207,15 +207,11 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
|
|
|
207
207
|
Logger.info(response);
|
|
208
208
|
|
|
209
209
|
if(response.success){
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
onResendSecurityCode(response.success, response.data ?? '');
|
|
214
|
-
}
|
|
210
|
+
// Fermeture boite de dialogue
|
|
211
|
+
setOpenPhoneNumberInput(false);
|
|
212
|
+
onResendSecurityCode(response.success, response.data ?? '');
|
|
215
213
|
}else{
|
|
216
|
-
|
|
217
|
-
onResendSecurityCode(response.success, response.error ?? '');
|
|
218
|
-
}
|
|
214
|
+
onResendSecurityCode(response.success, response.error ?? '');
|
|
219
215
|
}
|
|
220
216
|
|
|
221
217
|
}).catch(error => {
|