Add keys for steps (future-proof)
This commit is contained in:
parent
5e59e0b9d3
commit
9dd1268b69
@ -25,7 +25,7 @@ const A_DAY = 24 * 60 * A_MINUTE;
|
||||
const STEP_INFO = 0;
|
||||
const STEP_UPDATING = 1;
|
||||
const STEP_COMPLETED = 2;
|
||||
const STEP_ERROR = 3;
|
||||
const STEP_ERROR = 2;
|
||||
|
||||
const CHECK_INTERVAL = 1 * A_MINUTE;
|
||||
|
||||
|
@ -49,16 +49,20 @@ export default class UpgradeParity extends Component {
|
||||
steps={ [
|
||||
<FormattedMessage
|
||||
id='upgradeParity.step.info'
|
||||
key='info'
|
||||
defaultMessage='upgrade available' />,
|
||||
<FormattedMessage
|
||||
key='updating'
|
||||
id='upgradeParity.step.updating'
|
||||
defaultMessage='upgrading parity' />,
|
||||
store.step === STEP_ERROR
|
||||
? <FormattedMessage
|
||||
id='upgradeParity.step.error'
|
||||
key='error'
|
||||
defaultMessage='error' />
|
||||
: <FormattedMessage
|
||||
id='upgradeParity.step.completed'
|
||||
key='completed'
|
||||
defaultMessage='upgrade completed' />
|
||||
] }
|
||||
visible>
|
||||
@ -158,18 +162,8 @@ export default class UpgradeParity extends Component {
|
||||
);
|
||||
|
||||
case STEP_COMPLETED:
|
||||
return (
|
||||
<Completed>
|
||||
<FormattedMessage
|
||||
id='upgradeParity.completed'
|
||||
defaultMessage='Your upgrade to Parity {newversion} has been successfully completed.'
|
||||
values={ {
|
||||
newversion: <div className={ styles.version }>{ newversion }</div>
|
||||
} } />
|
||||
</Completed>
|
||||
);
|
||||
|
||||
case STEP_ERROR:
|
||||
if (store.error) {
|
||||
return (
|
||||
<Completed>
|
||||
<div>
|
||||
@ -186,6 +180,18 @@ export default class UpgradeParity extends Component {
|
||||
</Completed>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Completed>
|
||||
<FormattedMessage
|
||||
id='upgradeParity.completed'
|
||||
defaultMessage='Your upgrade to Parity {newversion} has been successfully completed.'
|
||||
values={ {
|
||||
newversion: <div className={ styles.version }>{ newversion }</div>
|
||||
} } />
|
||||
</Completed>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
renderConsensusInfo () {
|
||||
|
@ -72,7 +72,7 @@ export default class Title extends Component {
|
||||
return steps.map((label, index) => {
|
||||
return (
|
||||
<Step
|
||||
key={ index }>
|
||||
key={ label.key || index }>
|
||||
<StepLabel>
|
||||
{ label }
|
||||
</StepLabel>
|
||||
|
Loading…
Reference in New Issue
Block a user