mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-09 14:00:03 +00:00
avoid unnecessary touchbar updates
This commit is contained in:
parent
78cd2a0794
commit
1a1381a64a
@ -1,5 +1,5 @@
|
|||||||
import deepEqual from 'deep-equal'
|
import deepEqual from 'deep-equal'
|
||||||
import { Subject, distinctUntilChanged } from 'rxjs'
|
import { Subject, distinctUntilChanged, map } from 'rxjs'
|
||||||
import { ipcRenderer } from 'electron'
|
import { ipcRenderer } from 'electron'
|
||||||
import { Injectable, NgZone } from '@angular/core'
|
import { Injectable, NgZone } from '@angular/core'
|
||||||
import { AppService, HostAppService, Platform } from 'tabby-core'
|
import { AppService, HostAppService, Platform } from 'tabby-core'
|
||||||
@ -22,7 +22,10 @@ export class TouchbarService {
|
|||||||
|
|
||||||
app.tabOpened$.subscribe(tab => {
|
app.tabOpened$.subscribe(tab => {
|
||||||
tab.titleChange$.subscribe(() => this.update())
|
tab.titleChange$.subscribe(() => this.update())
|
||||||
tab.activity$.subscribe(() => this.update())
|
tab.activity$.pipe(
|
||||||
|
map(x => !x || tab === app.activeTab),
|
||||||
|
distinctUntilChanged(),
|
||||||
|
).subscribe(() => this.update())
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcRenderer.on('touchbar-selection', (_event, index) => this.zone.run(() => {
|
ipcRenderer.on('touchbar-selection', (_event, index) => this.zone.run(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user