File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 255255 font-weight : bold;
256256 user-select : none;
257257 cursor : pointer;
258- padding-left : 0.5rem ;
259- padding-right : 0.5rem ;
260258 background : var (--new-chart-background-color );
261259 color : var (--new-chart-text-color );
262260 float : right;
275273 width : 36% ;
276274 }
277275
278-
279276 # global-error {
280277 align-self : center;
281278 width : 60% ;
12731270}
12741271
12751272let firstLoad = true ;
1276-
1273+ let is_drawing = false ; // Prevent race condition leading to duplicate/dangling charts.
12771274async function drawAll ( ) {
1275+ if ( is_drawing ) return ;
1276+ is_drawing = true ;
1277+
12781278 let params = getParamsForURL ( ) ;
12791279 const chartsArray = document . getElementsByClassName ( 'chart' ) ;
12801280
13011301 document . getElementById ( 'edit' ) . style . display = 'inline-block' ;
13021302 document . getElementById ( 'search-span' ) . style . display = '' ;
13031303 hideError ( ) ;
1304- }
1305- else {
1306- const charts = document . getElementById ( 'charts' )
1307- charts . style . height = '0px' ;
1304+ } else {
1305+ document . getElementById ( 'charts' ) . style . height = '0px' ;
13081306 }
13091307 } ) ;
1308+
1309+ is_drawing = false ;
13101310}
13111311
13121312function resize ( ) {
You can’t perform that action at this time.
0 commit comments