File tree Expand file tree Collapse file tree
packages/scratch-gui/src/components/cards Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ class VideoStep extends React.Component {
102102
103103 // The Wistia API doesn't provide a callback for when the video is ready,
104104 // so we use the global _wq queue that Wistia provides for this purpose.
105- // See the below above for more details.
105+ // See the below for more details.
106106 // https://docs.wistia.com/docs/javascript-player-api#with-standard-embeds
107107 window . _wq = window . _wq || [ ] ;
108108 window . _wq . push ( {
@@ -141,6 +141,10 @@ class VideoStep extends React.Component {
141141
142142 const script2 = document . getElementById ( 'wistia-video-api' ) ;
143143 script2 . parentNode . removeChild ( script2 ) ;
144+
145+ // Clear the _wq queue to prevent old callbacks from firing
146+ // if the component is unmounted before the video is ready
147+ window . _wq = [ ] ;
144148 }
145149
146150 render ( ) {
You can’t perform that action at this time.
0 commit comments