cleanup
This commit is contained in:
parent
21cab65666
commit
6c29461f18
@ -10,7 +10,6 @@ import {
|
||||
ErrorService,
|
||||
FilterService,
|
||||
LoadingService,
|
||||
log,
|
||||
NestedFilter,
|
||||
OnAttach,
|
||||
OnDetach,
|
||||
@ -49,7 +48,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { SkippedService } from './services/skipped.service';
|
||||
import { FilePreviewStateService } from './services/file-preview-state.service';
|
||||
import { FileDataModel } from '../../../../models/file/file-data.model';
|
||||
import { filePreviewScreenProviders } from './utils';
|
||||
import { filePreviewScreenProviders } from './file-preview-providers';
|
||||
import { ManualAnnotationService } from '../../services/manual-annotation.service';
|
||||
import Annotation = Core.Annotations.Annotation;
|
||||
import PDFNet = Core.PDFNet;
|
||||
@ -521,7 +520,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
||||
.watch$(this.dossierId, this.fileId)
|
||||
.pipe(
|
||||
filter(f => !!f),
|
||||
log(),
|
||||
switchMap(file => this._fileUpdated(file)),
|
||||
)
|
||||
.subscribe();
|
||||
|
||||
@ -5,7 +5,6 @@ import { Dossier, File } from '@red/domain';
|
||||
import { DossiersService } from '../../../../../services/entity-services/dossiers.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { FilesMapService } from '../../../../../services/entity-services/files-map.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@Injectable()
|
||||
export class FilePreviewStateService {
|
||||
@ -14,9 +13,7 @@ export class FilePreviewStateService {
|
||||
readonly dossier$: Observable<Dossier>;
|
||||
readonly dossierId: string;
|
||||
readonly fileId: string;
|
||||
readonly hasBeenProcessed$: Observable<boolean>;
|
||||
private readonly _fileData$ = new BehaviorSubject<FileDataModel>(undefined);
|
||||
private _lastProcessed = '';
|
||||
|
||||
constructor(
|
||||
private readonly _dossiersService: DossiersService,
|
||||
@ -29,13 +26,6 @@ export class FilePreviewStateService {
|
||||
|
||||
this.fileData$ = this._fileData$.asObservable();
|
||||
this.file$ = _filesMapService.watch$(this.dossierId, this.fileId);
|
||||
this.hasBeenProcessed$ = this.file$.pipe(
|
||||
map(file => {
|
||||
const hasBeenProcessed = file.lastProcessed !== this._lastProcessed;
|
||||
this._lastProcessed = file.lastProcessed;
|
||||
return hasBeenProcessed;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
get fileData(): FileDataModel {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user