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_INFO = 0;
|
||||||
const STEP_UPDATING = 1;
|
const STEP_UPDATING = 1;
|
||||||
const STEP_COMPLETED = 2;
|
const STEP_COMPLETED = 2;
|
||||||
const STEP_ERROR = 3;
|
const STEP_ERROR = 2;
|
||||||
|
|
||||||
const CHECK_INTERVAL = 1 * A_MINUTE;
|
const CHECK_INTERVAL = 1 * A_MINUTE;
|
||||||
|
|
||||||
|
@ -49,16 +49,20 @@ export default class UpgradeParity extends Component {
|
|||||||
steps={ [
|
steps={ [
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='upgradeParity.step.info'
|
id='upgradeParity.step.info'
|
||||||
|
key='info'
|
||||||
defaultMessage='upgrade available' />,
|
defaultMessage='upgrade available' />,
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
key='updating'
|
||||||
id='upgradeParity.step.updating'
|
id='upgradeParity.step.updating'
|
||||||
defaultMessage='upgrading parity' />,
|
defaultMessage='upgrading parity' />,
|
||||||
store.step === STEP_ERROR
|
store.step === STEP_ERROR
|
||||||
? <FormattedMessage
|
? <FormattedMessage
|
||||||
id='upgradeParity.step.error'
|
id='upgradeParity.step.error'
|
||||||
|
key='error'
|
||||||
defaultMessage='error' />
|
defaultMessage='error' />
|
||||||
: <FormattedMessage
|
: <FormattedMessage
|
||||||
id='upgradeParity.step.completed'
|
id='upgradeParity.step.completed'
|
||||||
|
key='completed'
|
||||||
defaultMessage='upgrade completed' />
|
defaultMessage='upgrade completed' />
|
||||||
] }
|
] }
|
||||||
visible>
|
visible>
|
||||||
@ -158,18 +162,8 @@ export default class UpgradeParity extends Component {
|
|||||||
);
|
);
|
||||||
|
|
||||||
case STEP_COMPLETED:
|
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:
|
case STEP_ERROR:
|
||||||
|
if (store.error) {
|
||||||
return (
|
return (
|
||||||
<Completed>
|
<Completed>
|
||||||
<div>
|
<div>
|
||||||
@ -186,6 +180,18 @@ export default class UpgradeParity extends Component {
|
|||||||
</Completed>
|
</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 () {
|
renderConsensusInfo () {
|
||||||
|
@ -72,7 +72,7 @@ export default class Title extends Component {
|
|||||||
return steps.map((label, index) => {
|
return steps.map((label, index) => {
|
||||||
return (
|
return (
|
||||||
<Step
|
<Step
|
||||||
key={ index }>
|
key={ label.key || index }>
|
||||||
<StepLabel>
|
<StepLabel>
|
||||||
{ label }
|
{ label }
|
||||||
</StepLabel>
|
</StepLabel>
|
||||||
|
Loading…
Reference in New Issue
Block a user