Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

Commit

Permalink
Disable background throttling in the renderer instance. Fixes #46
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaine Schmeisser committed Aug 2, 2016
1 parent 2568d1b commit ff61249
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
3 changes: 3 additions & 0 deletions app/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ app.on('ready', function () {
alwaysOnTop: true,
fullscreenable: false,
title: 'Zazu',
webPreferences: {
backgroundThrottling: false,
},
})

checkForUpdate()
Expand Down
19 changes: 10 additions & 9 deletions app/zazu.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@ const Zazu = React.createClass({
componentDidMount () {
PluginStore.addThemeListener(this.updateTheme)
PluginStore.addResultListener(this.updateResults)
PluginStore.addQueryListener(this.updateQuery)

globalEmitter.on('showWindow', () => {
setImmediate(() => PluginStore.setQuery(''))
this.setState({
query: '',
results: [],
})
globalEmitter.on('hideWindow', () => {
PluginStore.setQuery('')
})
},

componentWillUnmount () {
PluginStore.removeResultListener(this.updateResults)
PluginStore.removeThemeListener(this.updateTheme)
PluginStore.removeResultListener(this.updateResults)
PluginStore.removeQueryListener(this.updateQuery)
},

updateTheme (theme) {
Expand All @@ -47,13 +45,16 @@ const Zazu = React.createClass({
})
},

handleQueryChange (query) {
PluginStore.setQuery(query)
updateQuery (query) {
this.setState({
query,
})
},

handleQueryChange (query) {
PluginStore.setQuery(query)
},

handleResultAction (result) {
result.next()
globalEmitter.emit('hideWindow')
Expand Down

0 comments on commit ff61249

Please sign in to comment.