Skip to content

Commit 84fc89c

Browse files
committed
chore: simplify rendering logic for statusline
1 parent f3b3209 commit 84fc89c

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

packages/trace-viewer/src/ui/uiModeView.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -461,20 +461,13 @@ export const UIModeView: React.FC<{}> = ({
461461
testModel={testModel}
462462
runTests={() => runTests('bounce-if-busy', visibleTestIds)} />
463463
<Toolbar noMinHeight={true}>
464-
{!progress ? (<StatusLine
465-
passed={0}
466-
failed={0}
467-
skipped={0}
468-
total={visibleTestIds.size}
469-
isRunning={false}
470-
/>) : (<StatusLine
471-
passed={progress.passed}
472-
failed={progress.failed}
473-
skipped={progress.skipped}
474-
total={isRunningTest ? runningState.testIds.size : progress.total}
464+
<StatusLine
465+
passed={progress?.passed ?? 0}
466+
failed={progress?.failed ?? 0}
467+
skipped={progress?.skipped ?? 0}
468+
total={progress ? (isRunningTest ? runningState.testIds.size : progress.total) : visibleTestIds.size}
475469
isRunning={!!isRunningTest}
476470
/>
477-
)}
478471
<ToolbarButton icon='play' title='Run all — F5' onClick={() => runTests('bounce-if-busy', visibleTestIds)} disabled={isRunningTest || isLoading}></ToolbarButton>
479472
<ToolbarButton icon='debug-stop' title={'Stop — ' + (isMac ? '⇧F5' : 'Shift + F5')} onClick={() => testServerConnection?.stopTests({})} disabled={!isRunningTest || isLoading}></ToolbarButton>
480473
<ToolbarButton icon='eye' title='Watch all' toggled={watchAll} onClick={() => {

0 commit comments

Comments
 (0)