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

fix: show splash screen on reload #1734

Merged
merged 1 commit into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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