feat: improve MFA by using user's own Email and Phone (#2002)

* refactor: mfa

* fix: clean code

* fix: clean code

* fix: fix crash and improve robot
This commit is contained in:
Yaodong Yu
2023-06-21 18:56:37 +08:00
committed by GitHub
parent 6ebca6dbe7
commit c391af4552
28 changed files with 528 additions and 362 deletions

View File

@ -17,13 +17,17 @@ import * as Setting from "../../Setting";
import React from "react";
export const CountryCodeSelect = (props) => {
const {onChange, style, disabled} = props;
const {onChange, style, disabled, initValue} = props;
const countryCodes = props.countryCodes ?? [];
const [value, setValue] = React.useState("");
React.useEffect(() => {
const initValue = countryCodes.length > 0 ? countryCodes[0] : "";
handleOnChange(initValue);
if (initValue !== undefined) {
setValue(initValue);
} else {
const initValue = countryCodes.length > 0 ? countryCodes[0] : "";
handleOnChange(initValue);
}
}, []);
const handleOnChange = (value) => {