1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

improve dashboard reload (#327)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2020-04-30 16:52:04 +03:00 committed by GitHub
parent 3066576382
commit 0f708c7fc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -145,8 +145,13 @@ export default function initMenu(opts: MenuOptions, promiseIpc: any) {
webContents.getFocusedWebContents().executeJavaScript('window.history.forward()')
}
},
{ role: 'reload' },
{ role: 'forceReload' },
{
label: 'Reload',
accelerator: 'CmdOrCtrl+R',
click () {
webContents.getFocusedWebContents().reload()
}
},
...(isDevelopment ? [
{ role: 'toggleDevTools'} as MenuItemConstructorOptions,
{

View File

@ -92,13 +92,14 @@ export class Router {
const asset = path.join(assetsPath, file)
readFile(asset, (err, data) => {
if (err) {
response.statusCode = 404
// default to index.html so that react routes work when page is refreshed
this.handleStaticFile("index.html", response)
} else {
const type = mimeTypes[path.extname(asset).slice(1)] || "text/plain";
response.setHeader("Content-Type", type);
response.write(data)
response.end()
}
response.end()
})
}