Skip to content

Commit

Permalink
fix(app): Enable robot update even if API reports up-to-date (#1721)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous authored Jun 19, 2018
1 parent 2a68dc5 commit 16bb8eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/src/components/RobotSettings/InformationCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ function InformationCard (props: Props) {
<OutlineButton
Component={Link}
to={updateUrl}
disabled={!availableUpdate}
>
{updateText}
</OutlineButton>
Expand Down
11 changes: 9 additions & 2 deletions app/src/components/RobotSettings/UpdateModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type DispatchProps = {
type Props = StateProps & DispatchProps

const UPDATE_MSG = "We recommend updating your robot's software to the latest version"
const ALREADY_UPDATED_MSG = "It looks like your robot is already up to date, but if you're experiencing issues you can re-apply the latest update."
const RESTART_MSG = 'Restart your robot to finish the update. It may take several minutes for your robot to restart.'
const DONE_MSG = 'Your robot has been updated. Please wait for your robot to fully restart, which may take several minutes.'

Expand All @@ -49,8 +50,14 @@ function UpdateModal (props: Props) {
let message
let button

const heading = availableUpdate
? `Version ${availableUpdate || ''} available`
: 'Robot is up to date'

if (!updateRequest.response) {
message = UPDATE_MSG
message = availableUpdate
? UPDATE_MSG
: ALREADY_UPDATED_MSG
button = inProgress
? {disabled: true, children: (<Spinner />)}
: {onClick: update, children: 'update'}
Expand All @@ -68,7 +75,7 @@ function UpdateModal (props: Props) {
return (
<AlertModal
onCloseClick={close}
heading={`Version ${availableUpdate || ''} Available`}
heading={heading}
buttons={[
{onClick: close, children: closeButtonText},
button
Expand Down

0 comments on commit 16bb8eb

Please sign in to comment.