Skip to content

Commit bced976

Browse files
committed
fix windows file loading
1 parent 9296dd4 commit bced976

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/services/netLoader.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ export function initializeNetLoader() {
2525
// Check if this is a local file:// URL
2626
if (url.startsWith('file://')) {
2727
// Extract the file path from the URL
28-
const filePath = url.replace('file://', '').replace(/^\/+/, '/');
28+
let filePath = url.replace('file://', '')
29+
if (process.platform === 'win32' && filePath.startsWith('/')) {
30+
filePath = filePath.slice(1);
31+
} else {
32+
filePath = filePath.replace(/^\/+/, '/');
33+
}
2934

3035
// Read the file using Electron IPC
3136
const data = await readLocalFile(filePath);

0 commit comments

Comments
 (0)