smart reanalysis

This commit is contained in:
Timo 2021-02-24 18:45:43 +02:00
parent 8215d48ccb
commit b2f52af296
2 changed files with 9 additions and 7 deletions

View File

@ -280,14 +280,10 @@
</div>
</section>
<redaction-full-page-loading-indicator [displayed]="!viewReady" [showIndicator]="false">
<redaction-full-page-loading-indicator [displayed]="!viewReady" [showIndicator]="!this.loadingMessage">
<h1 class="heading-l loading" *ngIf="loadingMessage">{{ loadingMessage | translate }}</h1>
<div class="analysis-progress">
<mat-progress-bar
[mode]="analysisProgress < 100 ? 'determinate' : 'indeterminate'"
[value]="analysisProgress"
*ngIf="analysisInterval"
></mat-progress-bar>
<div class="analysis-progress" *ngIf="loadingMessage">
<mat-progress-bar [mode]="indeterminateMode ? 'indeterminate' : 'determinate'" [value]="analysisProgress"></mat-progress-bar>
</div>
</redaction-full-page-loading-indicator>

View File

@ -119,6 +119,12 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy {
public analysisProgress: number;
public analysisInterval: number;
get indeterminateMode() {
return (
this.analysisProgress > 100 || this.appStateService.activeFile.analysisDuration < 3 * 1000 // it takes longer than usual - switch to indeterminate
); // on less than 3 seconds show indeterminate
}
@ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent;
@ViewChild('annotationsElement') private _annotationsElement: ElementRef;
@ViewChild('quickNavigation') private _quickNavigationElement: ElementRef;