|
1 | 1 | import { type FC, type PropsWithChildren, useEffect } from 'react'; |
2 | 2 |
|
3 | | -import { selectShouldDisplayDeviceCompromisedOnRoute } from '@suite/authenticity-checks'; |
| 3 | +import { |
| 4 | + selectFirmwareRevisionCheckErrorIfEnabled, |
| 5 | + selectShouldDisplayDeviceCompromisedOnRoute, |
| 6 | +} from '@suite/authenticity-checks'; |
4 | 7 | import { selectDesktopUpdateAllowPrerelease } from '@suite/desktop-update'; |
5 | | -import { useDevice } from '@suite/device'; |
| 8 | +import { rerunFwAuthenticityChecksThunk, useDevice } from '@suite/device'; |
6 | 9 | import { KillswitchMessageScreen } from '@suite/message-system'; |
7 | 10 | import { selectIsAnalyticsConfirmed } from '@suite-common/analytics-redux'; |
8 | | -import { useReportDeviceCompromised } from '@suite-common/firmware-authenticity'; |
| 11 | +import { |
| 12 | + useReportDeviceCompromised, |
| 13 | + useRetryFwAuthenticityChecks, |
| 14 | +} from '@suite-common/firmware-authenticity'; |
9 | 15 | import { selectActiveKillswitchMessage } from '@suite-common/message-system'; |
10 | 16 | import { Card } from '@trezor/components'; |
11 | 17 |
|
@@ -67,6 +73,10 @@ export const Preloader = ({ children }: PropsWithChildren) => { |
67 | 73 |
|
68 | 74 | const dispatch = useDispatch(); |
69 | 75 |
|
| 76 | + const firmwareRevisionCheckError = useSelector(selectFirmwareRevisionCheckErrorIfEnabled); |
| 77 | + const rerunFwAuthenticityChecksCall = () => dispatch(rerunFwAuthenticityChecksThunk()); |
| 78 | + useRetryFwAuthenticityChecks({ firmwareRevisionCheckError, rerunFwAuthenticityChecksCall }); |
| 79 | + |
70 | 80 | useEffect(() => { |
71 | 81 | // Analytics needs to be resolved before we show anything to the user. Until this is solved, |
72 | 82 | // we do not init anything. Especially nothing related to the devices/connect. With THP, |
|
0 commit comments