Skip to content

Commit 0131e43

Browse files
committed
fix: state of back-forward buttons on desktop
1 parent 47d293f commit 0131e43

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,4 @@
169169
"build/**/*"
170170
]
171171
}
172-
}
172+
}

electron/src/ElectronApp.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,18 @@ export default class ElectronApp {
130130

131131
private handleNavigate = (action: 'BACK' | 'FORWARD' | 'STATUS') => {
132132
if (!this.window) return
133+
const { navigationHistory } = this.window.webContents
134+
133135
const canNavigate = {
134-
canGoBack: this.window.webContents.navigationHistory.canGoBack,
135-
canGoForward: this.window.webContents.navigationHistory.canGoForward,
136+
canGoBack: navigationHistory.canGoBack(),
137+
canGoForward: navigationHistory.canGoForward(),
136138
}
137139
switch (action) {
138140
case 'BACK':
139-
this.window.webContents.navigationHistory.goBack()
141+
navigationHistory.goBack()
140142
break
141143
case 'FORWARD':
142-
this.window.webContents.navigationHistory.goForward()
144+
navigationHistory.goForward()
143145
break
144146
}
145147
EventBus.emit(EVENTS.canNavigate, canNavigate)

0 commit comments

Comments
 (0)