electron: Fix alt+left, alt+right navigation

Broken due to a change in Electron API:
https://github.com/electron/electron/pull/41577/files
This commit is contained in:
Elian Doran 2024-08-06 18:44:19 +03:00
parent f3641e5fa6
commit 743fee2783
No known key found for this signature in database

View File

@ -102,7 +102,7 @@ export default class Entrypoints extends Component {
if (utils.isElectron()) {
// standard JS version does not work completely correctly in electron
const webContents = utils.dynamicRequire('@electron/remote').getCurrentWebContents();
const activeIndex = parseInt(webContents.getActiveIndex());
const activeIndex = parseInt(webContents.navigationHistory.getActiveIndex());
webContents.goToIndex(activeIndex - 1);
}
@ -115,7 +115,7 @@ export default class Entrypoints extends Component {
if (utils.isElectron()) {
// standard JS version does not work completely correctly in electron
const webContents = utils.dynamicRequire('@electron/remote').getCurrentWebContents();
const activeIndex = parseInt(webContents.getActiveIndex());
const activeIndex = parseInt(webContents.navigationHistory.getActiveIndex());
webContents.goToIndex(activeIndex + 1);
}