FIX: Failing to open Camera Screen when Scanning to Import (iOS) #5831

This commit is contained in:
Marcos Rodriguez Velez 2023-11-19 13:43:31 -04:00 committed by Overtorment
parent 294790bc4a
commit 6e9fb487e0
3 changed files with 24 additions and 14 deletions

View file

@ -562,6 +562,7 @@ const Navigation = () => {
presentation: isDesktop ? 'containedModal' : 'fullScreenModal',
statusBarHidden: true,
}}
initialParams={ScanQRCode.initialParams}
/>
<RootStack.Screen name="PaymentCodeRoot" component={PaymentCodeStackRoot} options={NavigationDefaultOptions} />

View file

@ -86,8 +86,7 @@ const ScanQRCode = () => {
const [isLoading, setIsLoading] = useState(false);
const navigation = useNavigation();
const route = useRoute();
const showFileImportButton = route.params.showFileImportButton || false;
const { launchedBy, onBarScanned, onDismiss, onBarScannerDismissWithoutData = () => {} } = route.params;
const { launchedBy, onBarScanned, onDismiss, showFileImportButton, onBarScannerDismissWithoutData = () => {} } = route.params;
const scannedCache = {};
const { colors } = useTheme();
const isFocused = useIsFocused();
@ -404,3 +403,14 @@ const ScanQRCode = () => {
};
export default ScanQRCode;
ScanQRCode.initialParams = {
isLoading: false,
cameraStatusGranted: undefined,
backdoorPressed: undefined,
launchedBy: undefined,
urTotal: undefined,
urHave: undefined,
backdoorText: '',
backdoorVisible: false,
animatedQRCodeData: {},
}

View file

@ -3,6 +3,7 @@ import {
ActivityIndicator,
FlatList,
I18nManager,
InteractionManager,
Keyboard,
KeyboardAvoidingView,
LayoutAnimation,
@ -461,17 +462,15 @@ const WalletsAddMultisigStep2 = () => {
fs.showActionSheet({ anchor: findNodeHandle(openScannerButton.current) }).then(onBarScanned);
} else {
setIsProvideMnemonicsModalVisible(false);
setTimeout(() =>
requestCameraAuthorization().then(
() =>
navigation.navigate('ScanQRCodeRoot', {
screen: 'ScanQRCode',
params: {
onBarScanned,
showFileImportButton: true,
},
}),
650,
InteractionManager.runAfterInteractions(() =>
requestCameraAuthorization().then(() =>
navigation.navigate('ScanQRCodeRoot', {
screen: 'ScanQRCode',
params: {
onBarScanned,
showFileImportButton: true,
},
}),
),
);
}
@ -795,7 +794,7 @@ const styles = StyleSheet.create({
});
WalletsAddMultisigStep2.navigationOptions = navigationStyle({
headerTitle: null,
title: null,
gestureEnabled: false,
swipeEnabled: false,
});