File tree 2 files changed +14
-2
lines changed
docs/src/modules/components
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,17 @@ const styles = theme => ({
35
35
36
36
class Carbon extends React . Component {
37
37
componentDidMount ( ) {
38
+ const scriptSlot = document . querySelector ( '#carbon-ad' ) ;
39
+
40
+ // Concurrence issues
41
+ if ( ! scriptSlot ) {
42
+ return ;
43
+ }
44
+
38
45
const script = document . createElement ( 'script' ) ;
39
46
script . setAttribute ( 'async' , '' ) ;
40
47
script . src = '//cdn.carbonads.com/carbon.js?serve=CKYIL27L&placement=material-uicom' ;
41
48
script . id = '_carbonads_js' ;
42
- const scriptSlot = document . querySelector ( '#carbon-ad' ) ;
43
49
scriptSlot . appendChild ( script ) ;
44
50
}
45
51
Original file line number Diff line number Diff line change @@ -46,10 +46,16 @@ const styles = theme => ({
46
46
47
47
class CodeFund extends React . Component {
48
48
componentDidMount ( ) {
49
+ const scriptSlot = document . querySelector ( '#code-fund-script-slot' ) ;
50
+
51
+ // Concurrence issues
52
+ if ( ! scriptSlot ) {
53
+ return ;
54
+ }
55
+
49
56
const script = document . createElement ( 'script' ) ;
50
57
script . setAttribute ( 'async' , '' ) ;
51
58
script . src = '//codefund.io/scripts/71fdcb01-40be-4590-af75-cd1bd4773c2a/embed.js' ;
52
- const scriptSlot = document . querySelector ( '#code-fund-script-slot' ) ;
53
59
scriptSlot . appendChild ( script ) ;
54
60
}
55
61
You can’t perform that action at this time.
0 commit comments