@@ -51,6 +51,7 @@ export default function IntegrationBuilderPage({ files }: { files: Record<string
5151 const [ isLinkCopied , setLinkCopied ] = useState < boolean > ( false ) ;
5252 const [ IBCountdown , setIBCountdown ] = useState < number > ( 10 ) ;
5353 const [ builderView , setBuilderView ] = useState < boolean > ( true ) ;
54+ const [ abortCountdown , setAbortCountdown ] = useState < boolean > ( false ) ;
5455 const [ showPreviewModal , setShowPreviewModal ] = useState < boolean > ( false ) ;
5556 const url = new URL ( getWindowLocation ( ) ) ;
5657 const [ stepIndex , setStepIndex ] = useState (
@@ -118,6 +119,7 @@ export default function IntegrationBuilderPage({ files }: { files: Record<string
118119 ...builderOptions ,
119120 [ optionKey ] : optionValue ,
120121 } ) ;
122+ setAbortCountdown ( true ) ;
121123 } ;
122124
123125 const toggleBuilderView = async ( ) => {
@@ -173,7 +175,7 @@ export default function IntegrationBuilderPage({ files }: { files: Record<string
173175 if ( IBCountdown > 0 ) {
174176 setTimeout ( ( ) => setIBCountdown ( IBCountdown - 1 ) , 1000 ) ;
175177 }
176- if ( IBCountdown === 0 && builderView ) {
178+ if ( IBCountdown === 0 && builderView && ! abortCountdown ) {
177179 toggleBuilderView ( ) ;
178180 }
179181 } , [ IBCountdown ] ) ;
@@ -330,26 +332,8 @@ export default function IntegrationBuilderPage({ files }: { files: Record<string
330332 < div className = { styles . optionsHeader } >
331333 < h2 className = { styles . optionsHeaderText } > Builder Settings</ h2 >
332334 < div className = { styles . optionsHeaderButtonsContainer } >
333- { /* {integration.embedLink && (
334- <button
335- className={styles.previewButton}
336- onClick={() => togglePreviewModal(integration.embedLink)}
337- type="button"
338- id="headerButton"
339- >
340- Preview
341- </button>
342- )} */ }
343- { /* <button
344- className={styles.copyButton}
345- onClick={() => window.open(integration.sourceCodeLink, "_blank")}
346- type="button"
347- id="headerButton"
348- >
349- Source Code
350- </button> */ }
351335 < button className = { styles . hideButton } onClick = { toggleBuilderView } type = "button" >
352- { IBCountdown ? `${ IBCountdown } s` : "" }
336+ { IBCountdown && ! abortCountdown ? `${ IBCountdown } s` : "" }
353337 < svg
354338 width = "20"
355339 height = "21"
0 commit comments