Skip to content

Commit

Permalink
fix: Back Button not working in IdentificationModal (pagopa#2764)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bavuett committed Mar 19, 2023
1 parent fba680e commit cf70c50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ task copyDownloadableDepsToLibs(type: Copy) {
}

// Add the following line to the bottom of the file:
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
// apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

def isNewArchitectureEnabled() {
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,5 +317,9 @@
"scripts": {
"postchangelog": "node scripts/changelog/add_pivotal_stories.js"
}
},
"volta": {
"node": "16.19.0",
"yarn": "1.22.19"
}
}
6 changes: 4 additions & 2 deletions ts/screens/modal/IdentificationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { pipe } from "fp-ts/lib/function";
import * as O from "fp-ts/lib/Option";
import { Content, Text as NBText } from "native-base";
import * as React from "react";
import { View, Alert, Modal, StatusBar, StyleSheet } from "react-native";
import { View, Alert, Modal, StatusBar, StyleSheet, BackHandler } from "react-native";
import { connect } from "react-redux";
import { Dispatch } from "redux";
import { Link } from "../../components/core/typography/Link";
Expand Down Expand Up @@ -72,7 +72,9 @@ const checkPinInterval = 100 as Millisecond;
// the threshold of attempts after which it is necessary to activate the timer check
const checkTimerThreshold = maxAttempts - freeAttempts;

const onRequestCloseHandler = () => undefined;
const onRequestCloseHandler = () => {
BackHandler.exitApp();
};

const styles = StyleSheet.create({
header: {
Expand Down

0 comments on commit cf70c50

Please sign in to comment.