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:
parent
3066576382
commit
0f708c7fc5
@ -145,8 +145,13 @@ export default function initMenu(opts: MenuOptions, promiseIpc: any) {
|
|||||||
webContents.getFocusedWebContents().executeJavaScript('window.history.forward()')
|
webContents.getFocusedWebContents().executeJavaScript('window.history.forward()')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ role: 'reload' },
|
{
|
||||||
{ role: 'forceReload' },
|
label: 'Reload',
|
||||||
|
accelerator: 'CmdOrCtrl+R',
|
||||||
|
click () {
|
||||||
|
webContents.getFocusedWebContents().reload()
|
||||||
|
}
|
||||||
|
},
|
||||||
...(isDevelopment ? [
|
...(isDevelopment ? [
|
||||||
{ role: 'toggleDevTools'} as MenuItemConstructorOptions,
|
{ role: 'toggleDevTools'} as MenuItemConstructorOptions,
|
||||||
{
|
{
|
||||||
|
|||||||
@ -92,13 +92,14 @@ export class Router {
|
|||||||
const asset = path.join(assetsPath, file)
|
const asset = path.join(assetsPath, file)
|
||||||
readFile(asset, (err, data) => {
|
readFile(asset, (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
response.statusCode = 404
|
// default to index.html so that react routes work when page is refreshed
|
||||||
|
this.handleStaticFile("index.html", response)
|
||||||
} else {
|
} else {
|
||||||
const type = mimeTypes[path.extname(asset).slice(1)] || "text/plain";
|
const type = mimeTypes[path.extname(asset).slice(1)] || "text/plain";
|
||||||
response.setHeader("Content-Type", type);
|
response.setHeader("Content-Type", type);
|
||||||
response.write(data)
|
response.write(data)
|
||||||
|
response.end()
|
||||||
}
|
}
|
||||||
response.end()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user