Use SetTouchBar withe empty vector instead of DestroyTouchBar
This commit is contained in:
parent
d5dbe3676e
commit
51f1c5a557
8 changed files with 11 additions and 25 deletions
|
@ -199,20 +199,20 @@ Object.assign(BrowserWindow.prototype, {
|
|||
|
||||
// TouchBar API
|
||||
setTouchBar (touchBar) {
|
||||
// This property is set from within TouchBar
|
||||
if (this._touchBar != null) {
|
||||
this._touchBar._removeFromWindow(this)
|
||||
}
|
||||
|
||||
if (touchBar == null) {
|
||||
if (this._touchBar != null) {
|
||||
this._touchBar._removeFromWindow(this)
|
||||
}
|
||||
this._destroyTouchBar()
|
||||
this._setTouchBarItems([])
|
||||
return
|
||||
}
|
||||
|
||||
if (Array.isArray(touchBar)) {
|
||||
touchBar = new TouchBar(touchBar)
|
||||
}
|
||||
|
||||
this._touchBar = touchBar
|
||||
this._touchBar._addToWindow(this)
|
||||
touchBar._addToWindow(this)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue