Skip to content

Commit

Permalink
Miserably failed to fix the windows bug... Better now
Browse files Browse the repository at this point in the history
  • Loading branch information
agix committed Jan 2, 2017
1 parent 993141b commit 330fc19
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ function createWindow() {
const url = request.url.split('/static/')[1];
callback({ path: path.join(__dirname, 'build/static', url) });
} else if (request.url.endsWith('/index.html')) {
callback({ path: request.url.substring(prefix.length + 3) });
let addPrefix = 3;
if (process.platform === 'win32') {
addPrefix += 1;
}
callback({ path: request.url.substring(prefix.length + addPrefix) });
} else {
callback({ path: path.join(__dirname, 'build/index.html') });
}
Expand All @@ -33,7 +37,7 @@ function createWindow() {
height: 800,
});
// and load the index.html of the app.
win.loadURL('file://./build/index.html');
win.loadURL(`file://${__dirname}/build/index.html`);

// Open the DevTools.
// win.webContents.openDevTools();
Expand Down

0 comments on commit 330fc19

Please sign in to comment.