fixed #4629 - missing activity highlight

上级 555a21d6
import { Observable, Subject, distinctUntilChanged, debounceTime } from 'rxjs'
import { Observable, Subject, distinctUntilChanged } from 'rxjs'
import { EmbeddedViewRef, ViewContainerRef, ViewRef } from '@angular/core'
import { RecoveryToken } from '../api/tabRecovery'
import { BaseComponent } from './base.component'
......@@ -71,7 +71,7 @@ export abstract class BaseTabComponent extends BaseComponent {
get blurred$ (): Observable<void> { return this.blurred }
get titleChange$ (): Observable<string> { return this.titleChange.pipe(distinctUntilChanged()) }
get progress$ (): Observable<number|null> { return this.progress.pipe(distinctUntilChanged()) }
get activity$ (): Observable<boolean> { return this.activity.pipe(debounceTime(500)) }
get activity$ (): Observable<boolean> { return this.activity }
get destroyed$ (): Observable<void> { return this.destroyed }
get recoveryStateChangedHint$ (): Observable<void> { return this.recoveryStateChangedHint }
......@@ -113,16 +113,20 @@ export abstract class BaseTabComponent extends BaseComponent {
* Shows the acticity marker on the tab header
*/
displayActivity (): void {
this.hasActivity = true
this.activity.next(true)
if (!this.hasActivity) {
this.hasActivity = true
this.activity.next(true)
}
}
/**
* Removes the acticity marker from the tab header
*/
clearActivity (): void {
this.hasActivity = false
this.activity.next(false)
if (this.hasActivity) {
this.hasActivity = false
this.activity.next(false)
}
}
/**
......
......@@ -612,6 +612,13 @@ export class SplitTabComponent extends BaseTabComponent implements AfterViewInit
this.layoutInternal(this.root, 0, 0, 100, 100)
}
clearActivity (): void {
for (const tab of this.getAllTabs()) {
tab.clearActivity()
}
super.clearActivity()
}
private updateTitle (): void {
this.setTitle(this.getAllTabs().map(x => x.title).join(' | '))
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册