Browse Source

Add check for plaftorm

master
Loëck Vézien 7 years ago
parent
commit
f26c126c09
No known key found for this signature in database GPG Key ID: CBCDCE384E853AC4
  1. 26
      src/components/AccountPage/index.js
  2. 2
      src/components/DashboardPage/index.js
  3. 4
      src/index.ejs

26
src/components/AccountPage/index.js

@ -85,18 +85,20 @@ class AccountPage extends PureComponent<Props, State> {
return
}
ipcRenderer.send('touch-bar-update', {
text: account.name,
color: account.currency.color,
balance: {
currency: formatCurrencyUnit(account.unit, account.balance, {
showCode: true,
}),
counterValue: formatCurrencyUnit(getFiatUnit(counterValue), data.totalBalance, {
showCode: true,
}),
},
})
if (process.platform === 'darwin') {
ipcRenderer.send('touch-bar-update', {
text: account.name,
color: account.currency.color,
balance: {
currency: formatCurrencyUnit(account.unit, account.balance, {
showCode: true,
}),
counterValue: formatCurrencyUnit(getFiatUnit(counterValue), data.totalBalance, {
showCode: true,
}),
},
})
}
}
handleChangeSelectedTime = item =>

2
src/components/DashboardPage/index.js

@ -85,7 +85,7 @@ class DashboardPage extends PureComponent<Props, State> {
handleCalculateBalance = data => {
const { counterValue } = this.props
if (this._cacheBalance !== data.totalBalance) {
if (process.platform === 'darwin' && this._cacheBalance !== data.totalBalance) {
this._cacheBalance = data.totalBalance
ipcRenderer.send('touch-bar-update', {

4
src/index.ejs

@ -62,7 +62,9 @@
preloadEl.addEventListener('transitionend', () => preloadEl.remove())
}
ipcRenderer.emit('touch-bar-init')
if (process.platform === 'darwin') {
ipcRenderer.emit('touch-bar-init')
}
}
if (name === 'MainWindow') {

Loading…
Cancel
Save