Browse Source

Merge pull request #1579 from juan-cortes/issues-1576

Addresses the inconsistency between firmware hashes displayed
gre-patch-1
Gaëtan Renaudeau 6 years ago
committed by GitHub
parent
commit
47383927df
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      src/components/modals/UpdateFirmware/steps/01-step-install-full-firmware.js

18
src/components/modals/UpdateFirmware/steps/01-step-install-full-firmware.js

@ -128,22 +128,18 @@ class StepFullFirmwareInstall extends PureComponent<Props, State> {
} }
} }
formatHashName = (hash: string): string[] => { formatHashName = (hash: string): string => {
if (!hash) { if (!hash) {
return [] return ''
} }
const length = hash.length hash = hash.toUpperCase()
const half = Math.ceil(length / 2) return hash.length > 8 ? `${hash.slice(0, 4)}...${hash.substr(-4)}` : hash
const start = hash.slice(0, half)
const end = hash.slice(half)
return [start, end]
} }
renderBody = () => { renderBody = () => {
const { installing } = this.state const { installing } = this.state
const { t, firmware } = this.props const { t, firmware } = this.props
return installing ? ( return installing ? (
<Installing /> <Installing />
) : ( ) : (
@ -155,11 +151,7 @@ class StepFullFirmwareInstall extends PureComponent<Props, State> {
<Text ff="Open Sans|SemiBold" align="center" color="smoke"> <Text ff="Open Sans|SemiBold" align="center" color="smoke">
{t('manager.modal.identifier')} {t('manager.modal.identifier')}
</Text> </Text>
<Address> <Address>{firmware && this.formatHashName(firmware.hash)}</Address>
{firmware &&
firmware.hash &&
this.formatHashName(firmware.hash.toUpperCase()).join('\n')}
</Address>
</Box> </Box>
<Box mt={5}> <Box mt={5}>
<DeviceConfirm /> <DeviceConfirm />

Loading…
Cancel
Save