fix(electron): fix production build crashes

This commit is contained in:
plebeius
2026-01-30 13:12:02 +08:00
parent 16012b4239
commit 388a120c8e
2 changed files with 10 additions and 3 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ const ipfsClientLinuxPath = path.join(ipfsClientsPath, 'linux');
// const ipfsClientMacUrl = `https://github.com/plebbit/kubo/releases/download/v${ipfsClientVersion}/ipfs-darwin-amd64`
// const ipfsClientLinuxUrl = `https://github.com/plebbit/kubo/releases/download/v${ipfsClientVersion}/ipfs-linux-amd64`
// official kubo download links https://docs.ipfs.tech/install/command-line/#install-official-binary-distributions
const ipfsClientVersion = '0.32.1';
// NOTE: Keep this version in sync with the kubo version in package.json to avoid repo version mismatches
const ipfsClientVersion = '0.39.0';
// Resolve desired build arch: allow overriding via env (so cross-arch builds pick correct binary)
const resolveBuildArch = () => {
+8 -1
View File
@@ -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>