-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app): Fix double drop tip prompting after Error Recovery cancel a…
…ction (#17316) This commit brings the `lastRunCommandPromptedErrorRecovery` util back and adds the new and improved behavior to also check if Error Recovery is enabled (in settings). If it's not enabled, we need to run tip detection even if the last run command was recoverable.
- Loading branch information
Showing
4 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './getCommandTextData' | ||
export * from './lastRunCommandPromptedErrorRecovery' |
12 changes: 12 additions & 0 deletions
12
app/src/local-resources/commands/utils/lastRunCommandPromptedErrorRecovery.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { RunCommandSummary } from '@opentrons/api-client' | ||
// Whether the last run protocol command prompted Error Recovery, if Error Recovery is enabled. | ||
export function lastRunCommandPromptedErrorRecovery( | ||
summary: RunCommandSummary[] | null, | ||
isEREnabled: boolean | ||
): boolean { | ||
const lastProtocolCommand = summary?.findLast( | ||
command => command.intent !== 'fixit' && command.error != null | ||
) | ||
// All recoverable protocol commands have defined errors. | ||
return isEREnabled ? lastProtocolCommand?.error?.isDefined ?? false : false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters