File tree 1 file changed +7
-1
lines changed
plugins/plugin-codeflare-dashboard/src/components/Top
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -82,13 +82,18 @@ class Top extends React.PureComponent<Props, State> {
82
82
return ( ( n % d ) + d ) % d
83
83
}
84
84
85
+ /** Indicates the absence of a job selection */
86
+ private get NO_SELECTION ( ) {
87
+ return - 1
88
+ }
89
+
85
90
/** Do we have a selected group? */
86
91
private get hasSelection ( ) {
87
92
return this . state ?. selectedGroupIdx >= 0 && this . state ?. selectedGroupIdx < this . state . groups . length
88
93
}
89
94
90
95
private clearCurrentJobSelection ( ) {
91
- this . setState ( { selectedGroupIdx : - 1 } )
96
+ this . setState ( { selectedGroupIdx : this . NO_SELECTION } )
92
97
}
93
98
94
99
/** Current cluster context */
@@ -208,6 +213,7 @@ class Top extends React.PureComponent<Props, State> {
208
213
this . setState ( {
209
214
groups : [ ] ,
210
215
updateError : null ,
216
+ selectedGroupIdx : this . NO_SELECTION ,
211
217
watcher : await this . props . initWatcher ( context , this . onData ) ,
212
218
rawModel : Object . assign ( { hosts : [ ] , stats : this . emptyStats } , context ) ,
213
219
} )
You can’t perform that action at this time.
0 commit comments