{JSON.stringify(error, null, 2)}+ ) : signedIn ? ( +
Press start...
; + } + + // https://reactjs.org/blog/2020/02/26/react-v16.13.0.html#warnings-for-some-updates-during-render + useEffect(() => { + // Each new render get the data from the last subscription message + // Only execute pause() once + if ( + data && + climberStatus && + data.speedBackendCommands.command === 'end' && + data.speedBackendCommands.value !== lastStop + ) { + pause(); + setLastStop(data.speedBackendCommands.value); + } + }); + + // After useEffect to avoid the problem of having renderer less hooks in the case of an error + if (error) { + // TODO show a toast message https://elastic.github.io/eui/#/display/toast + console.log('USE Coach subscription backend error', error); + returnError: {error.message}
; + } + + // TODO lock start button while running + return ( + <> +Press start...
; + } + + if (error) { + // TODO show a toast message https://elastic.github.io/eui/#/display/toast + console.log('USE Coach subscription error', error); + returnError: {error.message}
; + } + + returnPress start...
; + } + + // https://reactjs.org/blog/2020/02/26/react-v16.13.0.html#warnings-for-some-updates-during-render + useEffect(() => { + // Each new render get the data from the last subscription message + // Only execute pause() once + if ( + data && + climberStatus && + data.strengthBackendCommands.command === 'end' && + data.strengthBackendCommands.value !== lastStop + ) { + pause(); + setLastStop(data.strengthBackendCommands.value); + } + }); + + // After useEffect to avoid the problem of having renderer less hooks in the case of an error + if (error) { + // TODO show a toast message https://elastic.github.io/eui/#/display/toast + console.log('USE Coach subscription backend error', error); + returnError: {error.message}
; + } + + // TODO have only one Calibrate button. + // Once pressed, show the other buttons (Tare, Calib+, Calib-, End) and start capturing data. + // Once calibrated, press end to restore to the initial position + return ( + <> +Press start...
; + } + + if (error) { + // TODO show a toast message https://elastic.github.io/eui/#/display/toast + console.log('USE Coach subscription error', error); + returnError: {error.message}
; + } + + returnYou found a page that doesn't exist.
+