Skip to content

Commit 6755417

Browse files
Clicking Copy shows the Copied message multiple times
1 parent 5cf6d21 commit 6755417

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

js/render-facade.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,23 @@
8888
document.body.dispatchEvent(event);
8989
};
9090

91-
// facade loads N times in the library (where N = the number of different chart libraries supported)
91+
// facade loads N times in the library and front end (where N = the number of different chart libraries supported)
9292
// so all charts are also loaded N times
9393
// this will ensure that no matter how many times facade is loaded, it initializes all charts only once.
9494
// fixed as part of the issue to add annotations.
95-
if(visualizer.page_type === 'library'){
96-
if(localStorage.getItem( 'viz-facade-loaded' ) === '1'){
97-
// prevent library from hanging.
98-
setTimeout( function(){
99-
localStorage.removeItem( 'viz-facade-loaded' );
100-
}, 2000);
101-
return;
102-
}
103-
localStorage.setItem( 'viz-facade-loaded', '1');
104-
// remove the flag so that repeated loading of the library does not cause problems.
95+
if(localStorage.getItem( 'viz-facade-loaded' ) === '1'){
96+
// prevent library from hanging.
10597
setTimeout( function(){
10698
localStorage.removeItem( 'viz-facade-loaded' );
10799
}, 2000);
100+
return;
108101
}
102+
localStorage.setItem( 'viz-facade-loaded', '1');
103+
// remove the flag so that repeated loading of the library does not cause problems.
104+
setTimeout( function(){
105+
localStorage.removeItem( 'viz-facade-loaded' );
106+
}, 2000);
107+
109108
$('body').trigger('visualizer:render:chart:start', visualizer);
110109
initActionsButtons(visualizer);
111110
registerDefaultActions();

0 commit comments

Comments
 (0)