From ec10857504af1488fba923f016703b8ec2ca252a Mon Sep 17 00:00:00 2001 From: b-Nollet Date: Thu, 19 Sep 2024 09:34:42 +0200 Subject: [PATCH] WIP --- packages/xo-web/src/xo-app/home/host-item.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/xo-web/src/xo-app/home/host-item.js b/packages/xo-web/src/xo-app/home/host-item.js index 9a5070e9372..0ab02735776 100644 --- a/packages/xo-web/src/xo-app/home/host-item.js +++ b/packages/xo-web/src/xo-app/home/host-item.js @@ -61,7 +61,8 @@ export default class HostItem extends Component { isHostTimeConsistentWithXoaTime: true, } - componentWillMount() { + async componentWillMount() { + await this.props.isPubKeyTooShort.then(isPubKeyTooShort => this.setState({ isPubKeyTooShort })) Promise.resolve(isHostTimeConsistentWithXoaTime(this.props.item)).then(value => this.setState({ isHostTimeConsistentWithXoaTime: value, @@ -138,8 +139,7 @@ export default class HostItem extends Component { () => this.state.isHostTimeConsistentWithXoaTime, this._getAreHostsVersionsEqual, () => this.props.state.hostsByPoolId[this.props.item.$pool], - () => this.props.isPubKeyTooShort, - (needsRestart, host, isMaintained, isHostTimeConsistentWithXoaTime, areHostsVersionsEqual, poolHosts, isPubKeyTooShort) => { + (needsRestart, host, isMaintained, isHostTimeConsistentWithXoaTime, areHostsVersionsEqual, poolHosts) => { const alerts = [] if (needsRestart) { @@ -198,19 +198,17 @@ export default class HostItem extends Component { }) } - if (isPubKeyTooShort) { - console.log("=====> isPubKeyTooShort:", isPubKeyTooShort) + if (this.state.isPubKeyTooShort) { + console.log("=====> isPubKeyTooShort:", this.state.isPubKeyTooShort) alerts.push({ level: 'warning', render: ( {_('pubKeyTooShort')} - -
    -
  • {_('longerCustomCertficate')}
  • -
  • {_('longerDefaultCertificate')}
  • -
-
+
    +
  • {_('longerCustomCertficate')}
  • +
  • {_('longerDefaultCertificate')}
  • +
), })