Browse Source

Fix touch-bar-init

master
Loëck Vézien 7 years ago
parent
commit
7dd2fa6186
No known key found for this signature in database GPG Key ID: CBCDCE384E853AC4
  1. 10
      src/components/layout/Default.js
  2. 6
      src/index.ejs

10
src/components/layout/Default.js

@ -35,7 +35,15 @@ type Props = {
class Default extends Component<Props> {
componentDidMount() {
window.requestAnimationFrame(() => (this._timeout = setTimeout(() => window.onAppReady(), 300)))
window.requestAnimationFrame(
() =>
(this._timeout = setTimeout(() => {
window.onAppReady()
if (process.platform === 'darwin') {
ipcRenderer.send('touch-bar-init')
}
}, 300)),
)
}
componentWillReceiveProps(nextProps: Props) {

6
src/index.ejs

@ -45,7 +45,7 @@
</div>
<div id="app"></div>
<script>
const { remote, ipcRenderer } = require('electron')
const { remote } = require('electron')
const { name } = remote.getCurrentWindow()
const preloadEl = document.getElementById('preload')
@ -61,10 +61,6 @@
preloadEl.addEventListener('transitionend', () => preloadEl.remove())
}
if (process.platform === 'darwin') {
ipcRenderer.emit('touch-bar-init')
}
}
if (name === 'MainWindow') {

Loading…
Cancel
Save