Move StandaloneRegistration to React

This commit is contained in:
Fedor Indutny 2021-11-30 18:51:53 +01:00 committed by GitHub
parent 67b17ec317
commit 7c1ce3366d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 452 additions and 1358 deletions

View file

@ -38,6 +38,22 @@ const mapStateToProps = (state: StateType) => {
renderSafetyNumber: (props: SafetyNumberProps) => (
<SmartSafetyNumberViewer {...props} />
),
requestVerification: (
type: 'sms' | 'voice',
number: string,
token: string
): Promise<void> => {
const accountManager = window.getAccountManager();
if (type === 'sms') {
return accountManager.requestSMSVerification(number, token);
}
return accountManager.requestVoiceVerification(number, token);
},
registerSingleDevice: (number: string, code: string): Promise<void> => {
return window.getAccountManager().registerSingleDevice(number, code);
},
theme: getTheme(state),
};
};