mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-03 14:06:25 +01:00
15 lines
661 B
TypeScript
15 lines
661 B
TypeScript
import { useSelector } from 'react-redux';
|
|
|
|
import { revisionCheckErrorScenarios } from '@suite-common/firmware-authenticity';
|
|
import { selectFirmwareRevisionCheckErrorIfEnabled } from '@suite-native/device';
|
|
|
|
export const useIsFwRevisionCheckOfflineError = () => {
|
|
const firmwareRevisionCheckError = useSelector(selectFirmwareRevisionCheckErrorIfEnabled);
|
|
|
|
return (
|
|
firmwareRevisionCheckError === 'cannot-perform-check-offline' &&
|
|
// if TS throws error, it means that the aforementioned logic is no longer valid, and it should be reworked
|
|
revisionCheckErrorScenarios[firmwareRevisionCheckError].type === 'softWarning'
|
|
);
|
|
};
|