File tree Expand file tree Collapse file tree 1 file changed +6
-20
lines changed Expand file tree Collapse file tree 1 file changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -26,31 +26,17 @@ interface OZWizardProps {
26
26
version ?: string ;
27
27
}
28
28
29
- // Global flag to prevent multiple script loads
30
- let wizardScriptLoaded = false ;
31
-
32
29
function OZWizardComponent ( { tab, lang, version } : OZWizardProps ) {
33
30
const wizardRef = useRef < HTMLElement > ( null ) ;
34
31
35
32
useEffect ( ( ) => {
36
- if ( ! wizardScriptLoaded ) {
37
- // Check if script is already in DOM
38
- const existingScript = document . querySelector (
39
- 'script[src="https://wizard.openzeppelin.com/build/embed.js"]' ,
40
- ) ;
41
-
42
- if ( ! existingScript ) {
43
- wizardScriptLoaded = true ;
33
+ // Dynamically load the wizard script
34
+ const script = document . createElement ( "script" ) ;
35
+ script . src = "https://wizard.openzeppelin.com/build/embed.js" ;
36
+ script . async = true ;
44
37
45
- // Dynamically load the wizard script
46
- const script = document . createElement ( "script" ) ;
47
- script . src = "https://wizard.openzeppelin.com/build/embed.js" ;
48
- script . async = true ;
49
-
50
- // Add script to head
51
- document . head . appendChild ( script ) ;
52
- }
53
- }
38
+ // Add script to head
39
+ document . head . appendChild ( script ) ;
54
40
} , [ ] ) ;
55
41
56
42
return (
You can’t perform that action at this time.
0 commit comments