Skip to content

Commit

Permalink
fix:disabling going back function on connectionless proof flow (#1051)
Browse files Browse the repository at this point in the history
Signed-off-by: Caroline Lucas Calheirani <[email protected]>
  • Loading branch information
CarolineLCa authored Dec 28, 2023
1 parent 279599d commit 4f26617
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/legacy/core/App/navigators/RootStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ const RootStack: React.FC = () => {
/>
<Stack.Screen name={Stacks.ContactStack} component={ContactStack} />
<Stack.Screen name={Stacks.NotificationStack} component={NotificationStack} />
<Stack.Screen name={Stacks.ConnectionStack} component={DeliveryStack} />
<Stack.Screen name={Stacks.ConnectionStack} component={DeliveryStack} options={{ gestureEnabled: false }} />
<Stack.Screen name={Stacks.ProofRequestsStack} component={ProofRequestStack} />
</Stack.Navigator>
)
Expand Down
7 changes: 6 additions & 1 deletion packages/legacy/core/App/screens/Connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CommonActions, useFocusEffect } from '@react-navigation/native'
import { StackScreenProps } from '@react-navigation/stack'
import React, { useCallback, useEffect, useMemo, useReducer, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import { AccessibilityInfo, Modal, ScrollView, StyleSheet, Text, View } from 'react-native'
import { AccessibilityInfo, BackHandler, Modal, ScrollView, StyleSheet, Text, View } from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'

import Button, { ButtonType } from '../components/buttons/Button'
Expand Down Expand Up @@ -119,6 +119,11 @@ const Connection: React.FC<ConnectionProps> = ({ navigation, route }) => {
navigation.getParent()?.navigate(TabStacks.HomeStack, { screen: Screens.Home })
}

useEffect(() => {
const backHandler = BackHandler.addEventListener('hardwareBackPress', () => true)
return () => backHandler.remove()
}, [])

useEffect(() => {
if (state.shouldShowDelayMessage && !state.notificationRecord) {
if (autoRedirectConnectionToHome) {
Expand Down

0 comments on commit 4f26617

Please sign in to comment.