@@ -8,17 +8,15 @@ import { useDeviceLowBatteryAlert } from '@suite-native/device';
88import { FirmwareInfoScreenContent , FirmwareInfoScreenFooter } from '@suite-native/firmware' ;
99import { Translation , TxKeyPath } from '@suite-native/intl' ;
1010import {
11- AppTabsRoutes ,
1211 DeviceOnboardingStackParamList ,
1312 DeviceOnboardingStackRoutes ,
14- HomeStackRoutes ,
1513 RootStackParamList ,
16- RootStackRoutes ,
1714 StackToStackCompositeNavigationProps ,
1815} from '@suite-native/navigation' ;
1916
2017import { updateOnboardingAnalyticsAtom } from '../../atoms' ;
2118import { DeviceOnboardingScreenWithExitButton } from '../components/DeviceOnboardingScreenWithExitButton' ;
19+ import { useExitAlert } from '../hooks/useExitAlert' ;
2220
2321type NavigationProps = StackToStackCompositeNavigationProps <
2422 DeviceOnboardingStackParamList ,
@@ -30,6 +28,7 @@ export const FirmwareInfoScreen = () => {
3028 const navigation = useNavigation < NavigationProps > ( ) ;
3129 const hasDeviceFirmwareInstalled = useSelector ( selectHasDeviceFirmwareInstalled ) ;
3230 const { showLowBatteryAlertIfNecessary } = useDeviceLowBatteryAlert ( ) ;
31+ const { handleExitButtonPress } = useExitAlert ( ) ;
3332
3433 const updateOnboardingAnalytics = useSetAtom ( updateOnboardingAnalyticsAtom ) ;
3534
@@ -43,15 +42,6 @@ export const FirmwareInfoScreen = () => {
4342 navigation . replace ( DeviceOnboardingStackRoutes . FirmwareInstallation ) ;
4443 } ;
4544
46- const handleCancel = ( ) => {
47- navigation . popTo ( RootStackRoutes . AppTabs , {
48- screen : AppTabsRoutes . HomeStack ,
49- params : {
50- screen : HomeStackRoutes . Home ,
51- } ,
52- } ) ;
53- } ;
54-
5545 const screenTitleTranslationId : TxKeyPath = hasDeviceFirmwareInstalled
5646 ? 'firmware.firmwareInfoScreen.title.update'
5747 : 'firmware.firmwareInfoScreen.title.install' ;
@@ -63,7 +53,7 @@ export const FirmwareInfoScreen = () => {
6353 footer = {
6454 < FirmwareInfoScreenFooter
6555 onUpdateConfirmation = { handleUpdateConfirmation }
66- onCancel = { handleCancel }
56+ onCancel = { handleExitButtonPress }
6757 />
6858 }
6959 >
0 commit comments