You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
2.0 KiB
48 lines
2.0 KiB
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="utf-8" /> |
|
<link rel="icon" href="%sveltekit.assets%/favicon.ico" /> |
|
<link rel="apple-touch-icon" href="%sveltekit.assets%/apple-touch-icon.png" /> |
|
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
|
<script> |
|
// Apply theme immediately to prevent flash |
|
// Use localStorage as quick fallback, layout will load proper theme from IndexedDB |
|
(function() { |
|
const savedTheme = localStorage.getItem('theme'); |
|
if (savedTheme === 'gitrepublic-black') { |
|
document.documentElement.setAttribute('data-theme', 'black'); |
|
} else { |
|
// Default to gitrepublic-dark (purple) |
|
document.documentElement.setAttribute('data-theme', 'dark'); |
|
} |
|
})(); |
|
|
|
// Handle unhandled promise rejections from relay errors |
|
// This prevents console errors from relay payment/restriction messages |
|
window.addEventListener('unhandledrejection', (event) => { |
|
const reason = event.reason; |
|
const errorMessage = reason instanceof Error ? reason.message : String(reason); |
|
|
|
// Handle relay-specific errors gracefully (payment requirements, restrictions, etc.) |
|
if (errorMessage.includes('restricted') || |
|
errorMessage.includes('Pay on') || |
|
errorMessage.includes('payment required') || |
|
errorMessage.includes('rate limit') || |
|
errorMessage.includes('bad req')) { |
|
// These are expected relay errors - prevent them from showing as uncaught errors |
|
event.preventDefault(); |
|
// Optionally log for debugging (but don't spam console) |
|
if (typeof console !== 'undefined' && console.debug) { |
|
console.debug('[Relay]', errorMessage); |
|
} |
|
} |
|
// Other unhandled rejections will still be logged by the browser |
|
}); |
|
</script> |
|
%sveltekit.head% |
|
</head> |
|
<body data-sveltekit-preload-data="hover"> |
|
<div style="display: contents">%sveltekit.body%</div> |
|
</body> |
|
</html>
|
|
|