Skip to content

Commit

Permalink
Ignore false did-fail-load event when loading diagram from electron
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus-Goectau committed Sep 21, 2023
1 parent 56f0591 commit 489c3fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CSETWebNg/main-electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,14 @@ function createWindow() {
})

// Load landing page if any window in app fails to load
mainWindow.webContents.on('did-fail-load', () => {
mainWindow.webContents.on('did-fail-load', (event) => {

// This event is triggered inside diagram even when the page loads successfully.
// Not sure why... so we're ignoring it for now.
if (event.sender.getURL().includes('diagram/src/main/webapp/index.html')) {
return;
}

mainWindow.loadURL(
url.format({
pathname: path.join(__dirname, 'dist/index.html'),
Expand Down

0 comments on commit 489c3fd

Please sign in to comment.