Skip to content

Commit 5fa76af

Browse files
Don't always fallback to sploder.com
1 parent c6e5c95 commit 5fa76af

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/local/offline.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@
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
}

src/local/start.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
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

0 commit comments

Comments
 (0)