Skip to content

Commit

Permalink
fix(ui): Allow more states for zone/segment cleanup and goto
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Oct 11, 2021
1 parent c46ef10 commit c738938
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions frontend/src/map/actions/GoToActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const GoToActions = (
onSuccess: onClear,
});

const canGo = status === "idle" || status === "docked";
const canGo = status === "idle" || status === "docked" || status === "paused" || status === "returning" || status === "error";

const handleClick = React.useCallback(() => {
if (!canGo) {
Expand Down Expand Up @@ -76,7 +76,7 @@ const GoToActions = (
!canGo &&
<Grid item>
<Typography variant="caption" color="textSecondary">
Can only go to point when idle
Cannot go to point while the robot is busy
</Typography>
</Grid>
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/map/actions/SegmentActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const SegmentActions = (
onSuccess: onClear,
});

const canClean = status === "idle" || status === "docked" || status === "error";
const canClean = status === "idle" || status === "docked" || status === "paused" || status === "returning" || status === "error";

const handleClick = React.useCallback(() => {
if (!canClean) {
Expand Down Expand Up @@ -137,7 +137,7 @@ const SegmentActions = (
!canClean &&
<Grid item>
<Typography variant="caption" color="textSecondary">
Can only start segment cleaning when idle
Cannot start segment cleaning while the robot is busy
</Typography>
</Grid>
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/map/actions/ZoneActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ZoneActions = (
refetch: refetchZoneProperties,
} = useZonePropertiesQuery();

const canClean = status === "idle" || status === "docked";
const canClean = status === "idle" || status === "docked" || status === "paused" || status === "returning" || status === "error";
const didSelectZones = zones.length > 0;

const handleClick = React.useCallback(() => {
Expand Down Expand Up @@ -181,7 +181,7 @@ const ZoneActions = (
{
(didSelectZones && !canClean) &&
<Typography variant="caption" color="textSecondary">
Can only start zone cleaning when idle
Cannot start zone cleaning while the robot is busy
</Typography>
}
</Grid>
Expand Down

0 comments on commit c738938

Please sign in to comment.