mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(electron): fix production build crashes
This commit is contained in:
+8
-1
@@ -18,7 +18,14 @@
|
||||
</script>
|
||||
<script>
|
||||
// Redirect non-hash URLs to hash URLs on initial load
|
||||
if (window.location.pathname && window.location.pathname !== '/' && window.location.pathname !== '/index.html' && !window.location.hash) {
|
||||
// Skip redirect for file:// protocol (Electron) or if pathname ends with index.html
|
||||
if (
|
||||
window.location.protocol !== 'file:' &&
|
||||
window.location.pathname &&
|
||||
window.location.pathname !== '/' &&
|
||||
!window.location.pathname.endsWith('/index.html') &&
|
||||
!window.location.hash
|
||||
) {
|
||||
window.location.replace('/#' + window.location.pathname + window.location.search);
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user