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

Make back/forward/refresh work the same as the arrow button in topbar (#3720)

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
chh 2021-09-02 14:21:36 +03:00 committed by GitHub
parent 40a2d9e05c
commit d6d66682f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -188,14 +188,14 @@ export function buildMenu(windowManager: WindowManager) {
label: "Back",
accelerator: "CmdOrCtrl+[",
click() {
webContents.getFocusedWebContents()?.goBack();
webContents.getAllWebContents().filter(wc => wc.getType() === "window").forEach(wc => wc.goBack());
}
},
{
label: "Forward",
accelerator: "CmdOrCtrl+]",
click() {
webContents.getFocusedWebContents()?.goForward();
webContents.getAllWebContents().filter(wc => wc.getType() === "window").forEach(wc => wc.goForward());
}
},
{

View File

@ -243,8 +243,10 @@ export class WindowManager extends Singleton {
if (frameInfo) {
this.sendToView({ channel: IpcRendererNavigationEvents.RELOAD_PAGE, frameInfo });
} else {
webContents.getFocusedWebContents()?.reload();
webContents.getFocusedWebContents()?.clearHistory();
webContents.getAllWebContents().filter(wc => wc.getType() === "window").forEach(wc => {
wc.reload();
wc.clearHistory();
});
}
}