Skip to content

Commit

Permalink
fix: sometimes opens two tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
will-stone committed Jun 10, 2019
1 parent 4691c7d commit a04350b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "browserosaurus",
"productName": "Browserosaurus",
"version": "5.4.5",
"version": "5.4.6",
"engines": {
"node": ">=10.4.1"
},
Expand Down
4 changes: 3 additions & 1 deletion scripts/notarize.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { notarize } from 'electron-notarize'

const projectRoot = require('path').resolve(__dirname, '..')

notarize({
appBundleId: 'com.browserosaurus',
appPath: __dirname + '/out/Browserosaurus-darwin-x64/Browserosaurus.app',
appPath: projectRoot + '/out/Browserosaurus-darwin-x64/Browserosaurus.app',
appleId: String(process.env.APPLE_ID),
appleIdPassword: `@keychain:AC_PASSWORD`,
ascProvider: 'Z89KPMLTFR',
Expand Down
9 changes: 8 additions & 1 deletion src/picker/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,14 @@ const App: React.FC = () => {

ipcRenderer.on(FAV_SET, (_: unknown, name: string) => {
dispatch(AFavSet({ name }))
mousetrap.bind('enter', () => ipcRenderer.send(ACTIVITY_RUN, name))
mousetrap.bind('enter', e => {
// When a browser has been selected with the mouse, it gets (invisible) focus.
// This means when enter is pressed next, it will activate the focused activity AND fire
// this key binding, causing two identical tabs to open in the selected browser.
// This fixes that.
e.preventDefault()
ipcRenderer.send(ACTIVITY_RUN, name)
})
})

ipcRenderer.on(
Expand Down

0 comments on commit a04350b

Please sign in to comment.