File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 1818 // Get the value of the 'retry' parameter
1919 var retryParameterValue = url . searchParams . get ( 'retry' ) ;
2020
21- // If the retry parameter is provided, use it, otherwise get the update URL from the config
22- if ( retryParameterValue !== null ) {
21+ // If the retry parameter is provided, use it
22+ if ( retryParameterValue !== null && retryParameterValue !== '' ) {
2323 return retryParameterValue ;
2424 } else {
25+ // Since we're in an iframe, we can't access electronAPI directly
26+ // Try to get it from the parent window if available
2527 try {
26- // Get the update URL from the main process
27- return await window . electronAPI . getUrl ( 'update' ) ;
28+ if ( window . parent && window . parent !== window && window . parent . electronAPI ) {
29+ return await window . parent . electronAPI . getUrl ( 'update' ) ;
30+ }
2831 } catch ( error ) {
29- console . error ( 'Error getting update URL:' , error ) ;
30- // Fallback to hardcoded URL in case of error
31- return 'https://sploder.com/update' ;
32+ console . log ( 'Cannot access parent window electronAPI (expected in iframe):' , error ) ;
3233 }
3334 }
3435}
Original file line number Diff line number Diff line change 2222 const updateUrl = await window . electronAPI . getUrl ( 'update' ) ;
2323 window . location . href = updateUrl ;
2424 } catch ( error ) {
25- console . error ( 'Error getting update URL:' , error ) ;
26- // Fallback to hardcoded URL in case of error
27- window . location . href = "https://sploder.com/update" ;
2825 }
2926 }
3027
You can’t perform that action at this time.
0 commit comments