Skip to content

Commit

Permalink
fix(macos): fix crashes under Mac OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Aug 4, 2018
1 parent 019700e commit 015447c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,14 @@ const stop = () => {
if(mainWindow)
mainWindow.hide()

if(tray)
tray.destroy()
// bug with mac os tray closing
// https://github.com/electron/electron/issues/9982
// https://github.com/electron/electron/issues/13556
if(process.platform !== 'darwin')
{
if(tray)
tray.destroy()
}

if(spider)
{
Expand Down
2 changes: 1 addition & 1 deletion src/background/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let config = {
sphinx: {
host : '127.0.0.1',
port : 9306,
connectionLimit: 12
connectionLimit: 10
},

spider: {
Expand Down
2 changes: 1 addition & 1 deletion src/background/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = class Feed {
config.feedDate = this.feedDate
await this.sphinx.query('delete from feed where id > 0')
let id = 0
return Promise.all(
await Promise.all(
this.feed.map(
async record => await this.sphinx.query('insert into feed(id, data) values(?, ?)', [++id, JSON.stringify(record)])
)
Expand Down

0 comments on commit 015447c

Please sign in to comment.