mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-05 19:09:54 +00:00
perf: don't re-set tab progress every time
This commit is contained in:
parent
2e6acd2fa1
commit
7fcf632378
@ -141,14 +141,19 @@ export class AppRootComponent {
|
|||||||
config.changed$.subscribe(() => this.updateVibrancy())
|
config.changed$.subscribe(() => this.updateVibrancy())
|
||||||
this.updateVibrancy()
|
this.updateVibrancy()
|
||||||
|
|
||||||
|
let lastProgress = null
|
||||||
this.app.tabOpened$.subscribe(tab => {
|
this.app.tabOpened$.subscribe(tab => {
|
||||||
this.unsortedTabs.push(tab)
|
this.unsortedTabs.push(tab)
|
||||||
tab.progress$.subscribe(progress => {
|
tab.progress$.subscribe(progress => {
|
||||||
|
if (lastProgress === progress) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (progress !== null) {
|
if (progress !== null) {
|
||||||
this.hostApp.getWindow().setProgressBar(progress / 100.0, { mode: 'normal' })
|
this.hostApp.getWindow().setProgressBar(progress / 100.0, { mode: 'normal' })
|
||||||
} else {
|
} else {
|
||||||
this.hostApp.getWindow().setProgressBar(-1, { mode: 'none' })
|
this.hostApp.getWindow().setProgressBar(-1, { mode: 'none' })
|
||||||
}
|
}
|
||||||
|
lastProgress = progress
|
||||||
})
|
})
|
||||||
this.noTabs = false
|
this.noTabs = false
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user