Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): Enable robot update even if API reports up-to-date #1721

Merged
merged 1 commit into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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