mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	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:
		| @@ -102,7 +102,7 @@ export default class Entrypoints extends Component { | |||||||
|         if (utils.isElectron()) { |         if (utils.isElectron()) { | ||||||
|             // standard JS version does not work completely correctly in electron |             // standard JS version does not work completely correctly in electron | ||||||
|             const webContents = utils.dynamicRequire('@electron/remote').getCurrentWebContents(); |             const webContents = utils.dynamicRequire('@electron/remote').getCurrentWebContents(); | ||||||
|             const activeIndex = parseInt(webContents.getActiveIndex()); |             const activeIndex = parseInt(webContents.navigationHistory.getActiveIndex()); | ||||||
|  |  | ||||||
|             webContents.goToIndex(activeIndex - 1); |             webContents.goToIndex(activeIndex - 1); | ||||||
|         } |         } | ||||||
| @@ -115,7 +115,7 @@ export default class Entrypoints extends Component { | |||||||
|         if (utils.isElectron()) { |         if (utils.isElectron()) { | ||||||
|             // standard JS version does not work completely correctly in electron |             // standard JS version does not work completely correctly in electron | ||||||
|             const webContents = utils.dynamicRequire('@electron/remote').getCurrentWebContents(); |             const webContents = utils.dynamicRequire('@electron/remote').getCurrentWebContents(); | ||||||
|             const activeIndex = parseInt(webContents.getActiveIndex()); |             const activeIndex = parseInt(webContents.navigationHistory.getActiveIndex()); | ||||||
|  |  | ||||||
|             webContents.goToIndex(activeIndex + 1); |             webContents.goToIndex(activeIndex + 1); | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user