Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
fix: show splash screen on reload (#1734)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarnsley authored Feb 28, 2020
1 parent dd83b7c commit c2580ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const createLoadingWindow = () => {
windows.loading = new BrowserWindow({
width: 800,
height: 600,
parent: windows.main,
skipTaskbar: true,
frame: false,
autoHideMenuBar: true,
Expand Down Expand Up @@ -133,6 +132,7 @@ function createWindow () {

windows.main.on('close', () => (windows.main = null))
windows.main.on('closed', () => (windows.main = null))
windows.main.on('hide', () => createLoadingWindow())

windows.main.webContents.on('did-finish-load', () => {
const name = packageJson.build.productName
Expand Down
11 changes: 10 additions & 1 deletion src/main/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,16 @@ const template = [
{
label: 'View',
submenu: [
{ role: 'reload' },
{
label: 'Reload',
accelerator: 'CmdOrCtrl+R',
click: (_, focusedWindow) => {
if (focusedWindow) {
focusedWindow.reload()
focusedWindow.hide()
}
}
},
{ role: 'forcereload' },
{ role: 'toggledevtools' },
{ type: 'separator' },
Expand Down

0 comments on commit c2580ac

Please sign in to comment.