File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
packages/trace-viewer/src/ui Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -40,18 +40,12 @@ export const CallTab: React.FunctionComponent<{
40
40
const startTimeMillis = action . startTime - startTimeOffset ;
41
41
const startTime = msToString ( startTimeMillis ) ;
42
42
43
- const duration = action . endTime ? msToString ( action . endTime - action . startTime ) : 'Timed Out' ;
44
-
45
43
return (
46
44
< div className = 'call-tab' >
47
45
< div className = 'call-line' > { action . apiName } </ div >
48
- {
49
- < >
50
- < div className = 'call-section' > Time</ div >
51
- < DateTimeCallLine name = 'start:' value = { startTime } />
52
- < DateTimeCallLine name = 'duration:' value = { duration } />
53
- </ >
54
- }
46
+ < div className = 'call-section' > Time</ div >
47
+ < DateTimeCallLine name = 'start:' value = { startTime } />
48
+ < DateTimeCallLine name = 'duration:' value = { renderDuration ( action ) } />
55
49
{
56
50
! ! paramKeys . length && < >
57
51
< div className = 'call-section' > Parameters</ div >
@@ -78,6 +72,15 @@ type Property = {
78
72
text : string ;
79
73
} ;
80
74
75
+ function renderDuration ( action : ActionTraceEventInContext ) : string {
76
+ if ( action . endTime )
77
+ return msToString ( action . endTime - action . startTime ) ;
78
+ else if ( ! ! action . error )
79
+ return 'Timed Out' ;
80
+ else
81
+ return 'Running' ;
82
+ }
83
+
81
84
function renderProperty ( property : Property ) {
82
85
let text = property . text . replace ( / \n / g, '↵' ) ;
83
86
if ( property . type === 'string' )
You can’t perform that action at this time.
0 commit comments