Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 30368cb

Browse files
Fix forward and back mouse actions
1 parent ce780b0 commit 30368cb

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

index.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ electron.app.on('ready', () => {
5757
const browserWindow = openMainWindow()
5858

5959
browserWindow.on('app-command', (e, cmd) => {
60-
if (cmd === 'browser-backward' && browserWindow.webContents.canGoBack()) {
61-
electron.ipcRenderer.send('goBack')
62-
}
63-
64-
if (cmd === 'browser-forward' && browserWindow.webContents.canGoForward()) {
65-
electron.ipcRenderer.send('goForward')
60+
switch (cmd) {
61+
case 'browser-backward': {
62+
browserWindow.webContents.send('goBack')
63+
break
64+
}
65+
case 'browser-forward': {
66+
browserWindow.webContents.send('goForward')
67+
break
68+
}
6669
}
6770
})
6871

@@ -163,6 +166,8 @@ function openMainWindow () {
163166
backgroundColor: '#EEE',
164167
icon: Path.join(__dirname, 'assets/icon.png')
165168
})
169+
170+
166171
windowState.manage(windows.main)
167172
windows.main.setSheetOffset(40)
168173
windows.main.on('close', function (e) {

lib/main-window.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ module.exports = function (config) {
417417
if (value.content.type === 'gathering') {
418418
api.about.async.latestValues(id, ['title', 'description'], (err, values) => {
419419
if (err) return cb(err)
420-
var text = `# ${values.title}\n\n${values.description}`
420+
const text = `# ${values.title}\n\n${values.description}`
421421
cb(null, text)
422422
})
423423
} else {

0 commit comments

Comments
 (0)