refactor(GUI): remove flash of white electron webContents workaround (#1575)

The lib/gui/etcher.js file contained a workaround to an Electron issue
that have since then been solved. In summary:

- Replace the `did-finish-load` event of `webContents` with
  `ready-to-show`, which is only emitted when the whole webview has
  finished loading

Change-Type: patch
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit is contained in:
Juan Cruz Viotti 2017-07-11 11:56:05 -04:00 committed by GitHub
parent dbe6ea68d5
commit 427a791de5

View File

@ -51,17 +51,7 @@ electron.app.on('ready', () => {
});
// Prevent flash of white when starting the application
// https://github.com/atom/electron/issues/2172
mainWindow.webContents.on('did-finish-load', () => {
const WEBVIEW_LOAD_TIMEOUT_MS = 100;
// The flash of white is still present for a very short
// while after the WebView reports it finished loading
setTimeout(() => {
mainWindow.show();
}, WEBVIEW_LOAD_TIMEOUT_MS);
});
mainWindow.on('ready-to-show', mainWindow.show);
mainWindow.on('closed', () => {
mainWindow = null;