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): disable module commands when protocol paused #5209

Merged
merged 5 commits into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions app/src/components/ModuleLiveStatusCards/TempDeckCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ type Props = {|
command: ModuleCommand,
args?: Array<mixed>
) => mixed,
isProtocolActive: boolean,
allowInteraction: boolean,
isCardExpanded: boolean,
toggleCard: boolean => mixed,
|}

export const TempDeckCard = ({
module,
sendModuleCommand,
isProtocolActive,
allowInteraction,
isCardExpanded,
toggleCard,
}: Props) => (
Expand All @@ -36,7 +36,7 @@ export const TempDeckCard = ({
>
<div className={styles.card_row}>
<StatusItem status={module.status} />
{!isProtocolActive && (
{allowInteraction && (
sfoster1 marked this conversation as resolved.
Show resolved Hide resolved
<TemperatureControl
module={module}
sendModuleCommand={sendModuleCommand}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ type Props = {|
command: ModuleCommand,
args?: Array<mixed>
) => mixed,
isProtocolActive: boolean,
allowInteraction: boolean,
isCardExpanded: boolean,
toggleCard: boolean => mixed,
|}

export const ThermocyclerCard = ({
module,
sendModuleCommand,
isProtocolActive,
allowInteraction,
isCardExpanded,
toggleCard,
}: Props) => {
Expand Down Expand Up @@ -113,7 +113,7 @@ export const ThermocyclerCard = ({
>
<div className={styles.card_row}>
<StatusItem status={module.status} />
{!isProtocolActive && (
{allowInteraction && (
<TemperatureControl
module={module}
sendModuleCommand={sendModuleCommand}
Expand Down
6 changes: 3 additions & 3 deletions app/src/components/ModuleLiveStatusCards/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { ThermocyclerCard } from './ThermocyclerCard'
export const ModuleLiveStatusCards = () => {
const modules = useSelector(getAttachedModulesForConnectedRobot)
const sendModuleCommand = useSendModuleCommand()
const isProtocolActive: boolean = useSelector(robotSelectors.getIsActive)
sfoster1 marked this conversation as resolved.
Show resolved Hide resolved
const isProtocolRunning: boolean = useSelector(robotSelectors.getIsRunning)
const [expandedCard, setExpandedCard] = React.useState(
modules.length > 0 ? modules[0].serial : ''
)
Expand Down Expand Up @@ -47,7 +47,7 @@ export const ModuleLiveStatusCards = () => {
toggleCard={makeToggleCard(module.serial)}
isCardExpanded={expandedCard === module.serial}
sendModuleCommand={sendModuleCommand}
isProtocolActive={isProtocolActive}
allowInteraction={!isProtocolRunning}
/>
)
case THERMOCYCLER:
Expand All @@ -58,7 +58,7 @@ export const ModuleLiveStatusCards = () => {
toggleCard={makeToggleCard(module.serial)}
isCardExpanded={expandedCard === module.serial}
sendModuleCommand={sendModuleCommand}
isProtocolActive={isProtocolActive}
allowInteraction={!isProtocolRunning}
/>
)
case MAGDECK:
Expand Down