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:
parent
40a2d9e05c
commit
d6d66682f6
@ -188,14 +188,14 @@ export function buildMenu(windowManager: WindowManager) {
|
|||||||
label: "Back",
|
label: "Back",
|
||||||
accelerator: "CmdOrCtrl+[",
|
accelerator: "CmdOrCtrl+[",
|
||||||
click() {
|
click() {
|
||||||
webContents.getFocusedWebContents()?.goBack();
|
webContents.getAllWebContents().filter(wc => wc.getType() === "window").forEach(wc => wc.goBack());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Forward",
|
label: "Forward",
|
||||||
accelerator: "CmdOrCtrl+]",
|
accelerator: "CmdOrCtrl+]",
|
||||||
click() {
|
click() {
|
||||||
webContents.getFocusedWebContents()?.goForward();
|
webContents.getAllWebContents().filter(wc => wc.getType() === "window").forEach(wc => wc.goForward());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -243,8 +243,10 @@ export class WindowManager extends Singleton {
|
|||||||
if (frameInfo) {
|
if (frameInfo) {
|
||||||
this.sendToView({ channel: IpcRendererNavigationEvents.RELOAD_PAGE, frameInfo });
|
this.sendToView({ channel: IpcRendererNavigationEvents.RELOAD_PAGE, frameInfo });
|
||||||
} else {
|
} else {
|
||||||
webContents.getFocusedWebContents()?.reload();
|
webContents.getAllWebContents().filter(wc => wc.getType() === "window").forEach(wc => {
|
||||||
webContents.getFocusedWebContents()?.clearHistory();
|
wc.reload();
|
||||||
|
wc.clearHistory();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user