diff --git a/lib/browser/api/browser-window.js b/lib/browser/api/browser-window.js index 9f5746980f67..31eac937a6e3 100644 --- a/lib/browser/api/browser-window.js +++ b/lib/browser/api/browser-window.js @@ -213,11 +213,13 @@ BrowserWindow.prototype.setTouchBar = function (touchBar) { this._setTouchBar(touchBar.toJSON()) } touchBar._owner = this - touchBar.items.forEach((item) => { item._owner = this; }) + touchBar.items.forEach((item) => { + item._owner = this + }) } BrowserWindow.prototype._updateTouchBarItem = function (itemID) { - this._refreshTouchBarItem(itemID); + this._refreshTouchBarItem(itemID) } module.exports = BrowserWindow diff --git a/lib/browser/api/touch-bar.js b/lib/browser/api/touch-bar.js index a008cc7778df..07b2631a77dd 100644 --- a/lib/browser/api/touch-bar.js +++ b/lib/browser/api/touch-bar.js @@ -44,14 +44,14 @@ class TouchBarItem { } } - updateConfig(newConfig) { + updateConfig (newConfig) { if (!this._owner) { - throw new Error('Cannot call methods on TouchBarItems without assigning to a BrowserWindow'); + throw new Error('Cannot call methods on TouchBarItems without assigning to a BrowserWindow') } - const dupConfig = Object.assign({}, newConfig); - delete dupConfig.id; - Object.assign(this.config, dupConfig); - this._owner._updateTouchBarItem(this.toJSON()); + const dupConfig = Object.assign({}, newConfig) + delete dupConfig.id + Object.assign(this.config, dupConfig) + this._owner._updateTouchBarItem(this.toJSON()) } toJSON () {