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

Loading…
Cancel
Save