Skip to content

Commit

Permalink
fix flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
ncdiehl11 committed May 14, 2024
1 parent 9dd7d99 commit 8b326fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/src/organisms/RunPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export const RunPreviewComponent = (
// we only ever want one request done for terminal runs because this is a heavy request
const {
data: commandsFromQueryResponse,
isLoading: isRunCommandsLoading,
} = useNotifyAllCommandsAsPreSerializedList(
runId,
{ cursor: 0, pageLength: MAX_COMMANDS },
Expand All @@ -72,8 +71,7 @@ export const RunPreviewComponent = (
}
)
const commandsFromQuery = commandsFromQueryResponse?.data
const nullCheckedCommandsFromQuery =
commandsFromQuery == null ? robotSideAnalysis?.commands : commandsFromQuery
const nullCheckedCommandsFromQuery = commandsFromQuery ?? []
const viewPortRef = React.useRef<HTMLDivElement | null>(null)
const currentRunCommandKey = useNotifyLastRunCommand(runId, {
refetchInterval: LIVE_RUN_COMMANDS_POLL_MS,
Expand All @@ -84,7 +82,7 @@ export const RunPreviewComponent = (
] = React.useState<boolean>(true)
if (robotSideAnalysis == null) return null
const commands =
(isRunTerminal && !isRunCommandsLoading
(isRunTerminal
? nullCheckedCommandsFromQuery
: robotSideAnalysis.commands) ?? []
// pass relevant data from run rather than analysis so that CommandText utilities can properly hash the entities' IDs
Expand Down

0 comments on commit 8b326fc

Please sign in to comment.