@@ -72,33 +72,27 @@ export class GraphApp extends SignalWatcher(LitElement) {
72
72
@gl-select-commits =${ this . handleHeaderSearchNavigation }
73
73
> </ gl-graph-header >
74
74
< div class ="graph__workspace ">
75
- ${ when (
76
- ! this . graphState . state . allowed ,
77
- ( ) => html `< gl-graph-gate class ="graph__gate "> </ gl-graph-gate > ` ,
78
- ) }
75
+ ${ when ( ! this . graphState . allowed , ( ) => html `< gl-graph-gate class ="graph__gate "> </ gl-graph-gate > ` ) }
79
76
< main id ="main " class ="graph__panes ">
80
77
< div class ="graph__graph-pane ">
81
78
${ when (
82
- this . graphState . state . config ?. minimap !== false ,
79
+ this . graphState . config ?. minimap !== false ,
83
80
( ) => html `
84
81
< gl-graph-minimap-container
85
82
.activeDay =${ this . graphState . activeDay }
86
- .disabled =${ ! this . graphState . state . config ?. minimap }
87
- .rows=${ this . graphState . state . rows ?? [ ] }
88
- .rowsStats=${ this . graphState . state . rowsStats }
89
- .dataType=${ this . graphState . state . config ?. minimapDataType ?? 'commits' }
90
- .markerTypes=${ this . graphState . state . config ?. minimapMarkerTypes ?? [ ] }
91
- .refMetadata=${ this . graphState . state . refsMetadata }
83
+ .disabled =${ ! this . graphState . config ?. minimap }
84
+ .rows=${ this . graphState . rows ?? [ ] }
85
+ .rowsStats=${ this . graphState . rowsStats }
86
+ .dataType=${ this . graphState . config ?. minimapDataType ?? 'commits' }
87
+ .markerTypes=${ this . graphState . config ?. minimapMarkerTypes ?? [ ] }
88
+ .refMetadata=${ this . graphState . refsMetadata }
92
89
.searchResults=${ this . graphState . searchResults }
93
90
.visibleDays=${ this . graphState . visibleDays }
94
91
@gl-graph-minimap-selected=${ this . handleMinimapDaySelected }
95
92
> </ gl-graph-minimap-container >
96
93
` ,
97
94
) }
98
- ${ when (
99
- this . graphState . state . config ?. sidebar ,
100
- ( ) => html `< gl-graph-sidebar > </ gl-graph-sidebar > ` ,
101
- ) }
95
+ ${ when ( this . graphState . config ?. sidebar , ( ) => html `< gl-graph-sidebar > </ gl-graph-sidebar > ` ) }
102
96
< gl-graph-hover id ="commit-hover " distance =${ 0 } skidding =${ 15 } > </ gl-graph-hover >
103
97
< gl-graph-wrapper
104
98
@gl-graph-change-selection =${ this . handleGraphSelectionChanged }
@@ -121,15 +115,15 @@ export class GraphApp extends SignalWatcher(LitElement) {
121
115
}
122
116
123
117
private handleMinimapDaySelected ( e : CustomEvent < GraphMinimapDaySelectedEventDetail > ) {
124
- if ( ! this . graphState . state . rows ) return ;
118
+ if ( ! this . graphState . rows ) return ;
125
119
126
120
let { sha } = e . detail ;
127
121
if ( sha == null ) {
128
122
const date = e . detail . date ?. getTime ( ) ;
129
123
if ( date == null ) return ;
130
124
131
125
// Find closest row to the date
132
- const closest = this . graphState . state . rows . reduce ( ( prev , curr ) => {
126
+ const closest = this . graphState . rows . reduce ( ( prev , curr ) => {
133
127
return Math . abs ( curr . date - date ) < Math . abs ( prev . date - date ) ? curr : prev ;
134
128
} ) ;
135
129
sha = closest . sha ;
0 commit comments