diff --git a/src/components/AccountPage/index.js b/src/components/AccountPage/index.js index 74e37e8b..b2e05625 100644 --- a/src/components/AccountPage/index.js +++ b/src/components/AccountPage/index.js @@ -85,18 +85,20 @@ class AccountPage extends PureComponent { 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 => diff --git a/src/components/DashboardPage/index.js b/src/components/DashboardPage/index.js index b28576a6..443f1101 100644 --- a/src/components/DashboardPage/index.js +++ b/src/components/DashboardPage/index.js @@ -85,7 +85,7 @@ class DashboardPage extends PureComponent { 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', { diff --git a/src/index.ejs b/src/index.ejs index 9f871326..1f221f2a 100644 --- a/src/index.ejs +++ b/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') {