mirror of
https://github.com/Eugeny/tabby.git
synced 2025-01-30 14:20:18 +08: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())
|
||||
this.updateVibrancy()
|
||||
|
||||
let lastProgress = null
|
||||
this.app.tabOpened$.subscribe(tab => {
|
||||
this.unsortedTabs.push(tab)
|
||||
tab.progress$.subscribe(progress => {
|
||||
if (lastProgress === progress) {
|
||||
return
|
||||
}
|
||||
if (progress !== null) {
|
||||
this.hostApp.getWindow().setProgressBar(progress / 100.0, { mode: 'normal' })
|
||||
} else {
|
||||
this.hostApp.getWindow().setProgressBar(-1, { mode: 'none' })
|
||||
}
|
||||
lastProgress = progress
|
||||
})
|
||||
this.noTabs = false
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user