Skip to content

Commit

Permalink
refactor(interaction): adding check if app is locked to interaction n…
Browse files Browse the repository at this point in the history
…avigation
  • Loading branch information
thwalln committed Nov 8, 2022
1 parent 4583faa commit b89f377
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/screens/Modals/Interaction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '~/utils/screenSettings'
import ServiceRedirect from './ServiceRedirect'
import eID from './eID'
import { getIsAppLocked } from '~/modules/account/selectors'

export type InteractionStackParamList = {
[ScreenNames.Scanner]: undefined
Expand All @@ -35,12 +36,13 @@ const InteractionStack = createStackNavigator<InteractionStackParamList>()
const Interaction: React.FC = () => {
const isInteracting = useSelector(getInteractionType)
const navigation = useNavigation()
const isAppLocked = useSelector(getIsAppLocked)

useEffect(() => {
if (isInteracting) {
if (isInteracting && !isAppLocked) {
navigation.navigate(ScreenNames.InteractionFlow)
}
}, [isInteracting])
}, [isInteracting, isAppLocked])

return (
<InteractionStack.Navigator headerMode="none" mode="modal">
Expand Down

0 comments on commit b89f377

Please sign in to comment.