Skip to content

Commit

Permalink
fix: Alert conflict with biometric screen fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
juanky201271 committed Feb 12, 2025
1 parent c976af9 commit 2dc6b6b
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions app/LoadingApp/LoadingApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
EmitterSubscription,
AppState,
NativeEventSubscription,
Platform,
} from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';
import { useTheme } from '@react-navigation/native';
Expand Down Expand Up @@ -1225,26 +1226,32 @@ export class LoadingAppClass extends Component<LoadingAppClassProps, LoadingAppC
recoverRecoveryWalletInfo = async (security: boolean) => {
// recover the wallet keys from the device
const wallet = await getRecoveryWalletInfo();
// in IOS the App + OS needs some time to close the biometric screen
// then the Alert can be too fast.
if (wallet.seed || wallet.ufvk) {
const txt = (wallet.seed || wallet.ufvk) + '\n\n' + wallet.birthday;
Alert.alert(
this.props.translate('loadedapp.walletseed-basic') as string,
(security ? '' : ((this.props.translate('loadingapp.recoverkeysinstall') + '\n\n') as string)) + txt,
[
{
text: this.props.translate('copy') as string,
onPress: () => {
Clipboard.setString(txt);
this.addLastSnackbar({
message: this.props.translate('txtcopied') as string,
duration: SnackbarDurationEnum.short,
});
setTimeout(() => {
Alert.alert(
this.props.translate('loadedapp.walletseed-basic') as string,
(security ? '' : ((this.props.translate('loadingapp.recoverkeysinstall') + '\n\n') as string)) + txt,
[
{
text: this.props.translate('copy') as string,
onPress: () => {
Clipboard.setString(txt);
this.addLastSnackbar({
message: this.props.translate('txtcopied') as string,
duration: SnackbarDurationEnum.short,
});
},
},
},
{ text: this.props.translate('cancel') as string, style: 'cancel' },
],
{ cancelable: false },
);
{ text: this.props.translate('cancel') as string, style: 'cancel' },
],
{ cancelable: false },
);
// IOS needs time to close the biometric screen.
// but Android I don't think so, a little bit Just in case.
}, Platform.OS === GlobalConst.platformOSios ? 2000 : 100);
}
};

Expand Down

0 comments on commit 2dc6b6b

Please sign in to comment.