RED-3800: fix undefined lastChange

This commit is contained in:
Dan Percic 2022-12-12 19:32:54 +02:00
parent b6e3046d21
commit 018a8c8d54
3 changed files with 2 additions and 4 deletions

View File

@ -12,7 +12,6 @@ import {
ViewChild,
} from '@angular/core';
import { ActivatedRoute, ActivatedRouteSnapshot, NavigationExtras, Router } from '@angular/router';
import { Core } from '@pdftron/webviewer';
import {
AutoUnsubscribe,
bool,
@ -72,7 +71,6 @@ import { ConfigService } from '@services/config.service';
import { ReadableRedactionsService } from '../pdf-viewer/services/readable-redactions.service';
import { ROLES } from '@users/roles';
import { SuggestionsService } from './services/suggestions.service';
import Annotation = Core.Annotations.Annotation;
const textActions = [TextPopups.ADD_DICTIONARY, TextPopups.ADD_FALSE_POSITIVE];

View File

@ -182,7 +182,7 @@ export class FileDataService extends EntitiesService<AnnotationWrapper, Annotati
const redactionLogCopy = JSON.parse(JSON.stringify(redactionLog));
redactionLogCopy.redactionLogEntry = redactionLogCopy.redactionLogEntry.reduce((filtered, entry) => {
const lastChange = entry.manualChanges.at(-1);
const isRemoveChange = this.#isRemoveChange(lastChange.manualRedactionType);
const isRemoveChange = this.#isRemoveChange(lastChange?.manualRedactionType);
if (isRemoveChange) {
entry.manualChanges.pop();
filtered.push(entry);

View File

@ -12,10 +12,10 @@ import Annotation = Core.Annotations.Annotation;
@Injectable()
export class ReadableRedactionsService {
readonly active$: Observable<boolean>;
readonly #enableIcon = this._convertPath('/assets/icons/general/pdftron-action-enable-tooltips.svg');
readonly #disableIcon = this._convertPath('/assets/icons/general/pdftron-action-disable-tooltips.svg');
readonly #active$ = new BehaviorSubject<boolean>(true);
readonly active$: Observable<boolean>;
constructor(
@Inject(BASE_HREF_FN) private readonly _convertPath: BaseHrefFn,