viewed pages cleanup
This commit is contained in:
parent
64e8ce5242
commit
c537fe5e5e
@ -1,9 +1,9 @@
|
||||
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { ViewedPages, ViewedPagesControllerService } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
import {Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges} from '@angular/core';
|
||||
import {ViewedPages, ViewedPagesControllerService} from '@redaction/red-ui-http';
|
||||
import {AppStateService} from '@state/app-state.service';
|
||||
import {PermissionsService} from '@services/permissions.service';
|
||||
import {ConfigService} from '@services/config.service';
|
||||
import {Subscription} from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-page-indicator',
|
||||
@ -27,7 +27,8 @@ export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy {
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _configService: ConfigService,
|
||||
private readonly _permissionService: PermissionsService
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
get read() {
|
||||
return this.viewedPages?.pages?.findIndex(p => p.page === this.number) >= 0;
|
||||
@ -95,9 +96,9 @@ export class PageIndicatorComponent implements OnChanges, OnInit, OnDestroy {
|
||||
|
||||
private _markPageRead() {
|
||||
this._viewedPagesControllerService
|
||||
.addPage({ page: this.number }, this._appStateService.activeDossierId, this._appStateService.activeFileId)
|
||||
.subscribe(page => {
|
||||
this.viewedPages?.pages?.push(page);
|
||||
.addPage({page: this.number}, this._appStateService.activeDossierId, this._appStateService.activeFileId)
|
||||
.subscribe(() => {
|
||||
this.viewedPages?.pages?.push({page: this.number, fileId: this._appStateService.activeFile});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user