diff --git a/UI/Web/src/app/_services/action-factory.service.ts b/UI/Web/src/app/_services/action-factory.service.ts index 469b8c836..61fee39ec 100644 --- a/UI/Web/src/app/_services/action-factory.service.ts +++ b/UI/Web/src/app/_services/action-factory.service.ts @@ -237,6 +237,7 @@ export class ActionFactoryService { dummyCallback(action: ActionItem, entity: any) {} dummyShouldRender(action: ActionItem, entity: any, user: User) {return true;} basicReadRender(action: ActionItem, entity: any, user: User) { + if (entity === null || entity === undefined) return true; if (!entity.hasOwnProperty('pagesRead') && !entity.hasOwnProperty('pages')) return true; switch (action.action) { diff --git a/UI/Web/src/app/cards/bulk-operations/bulk-operations.component.html b/UI/Web/src/app/cards/bulk-operations/bulk-operations.component.html index 77b580d48..34ae3aec2 100644 --- a/UI/Web/src/app/cards/bulk-operations/bulk-operations.component.html +++ b/UI/Web/src/app/cards/bulk-operations/bulk-operations.component.html @@ -23,7 +23,7 @@ {{t('mark-as-read')}} } - + Bulk Actions diff --git a/UI/Web/src/app/cards/bulk-operations/bulk-operations.component.ts b/UI/Web/src/app/cards/bulk-operations/bulk-operations.component.ts index 7d65f12d8..b68309782 100644 --- a/UI/Web/src/app/cards/bulk-operations/bulk-operations.component.ts +++ b/UI/Web/src/app/cards/bulk-operations/bulk-operations.component.ts @@ -85,8 +85,6 @@ export class BulkOperationsComponent implements OnInit { this.actionCallback(action, null); } - - executeAction(action: Action) { const foundActions = this.actions.filter(act => act.action === action); if (foundActions.length > 0) { diff --git a/UI/Web/src/app/cards/series-card/series-card.component.ts b/UI/Web/src/app/cards/series-card/series-card.component.ts index 262396baa..c6cfa825f 100644 --- a/UI/Web/src/app/cards/series-card/series-card.component.ts +++ b/UI/Web/src/app/cards/series-card/series-card.component.ts @@ -37,7 +37,6 @@ import {takeUntilDestroyed} from "@angular/core/rxjs-interop"; import {map} from "rxjs/operators"; import {AccountService} from "../../_services/account.service"; import {BulkSelectionService} from "../bulk-selection.service"; -import {User} from "../../_models/user"; import {ScrollService} from "../../_services/scroll.service"; import {ReaderService} from "../../_services/reader.service"; import {SeriesFormatComponent} from "../../shared/series-format/series-format.component"; @@ -145,8 +144,6 @@ export class SeriesCardComponent implements OnInit, OnChanges { */ prevOffset: number = 0; selectionInProgress: boolean = false; - private user: User | undefined; - @HostListener('touchmove', ['$event']) onTouchMove(event: TouchEvent) { @@ -190,15 +187,15 @@ export class SeriesCardComponent implements OnInit, OnChanges { ngOnChanges(changes: any) { if (this.series) { - this.accountService.currentUser$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(user => { - this.user = user; - }); + // this.accountService.currentUser$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(user => { + // this.user = user; + // }); this.download$ = this.downloadService.activeDownloads$.pipe(takeUntilDestroyed(this.destroyRef), map((events) => { return this.downloadService.mapToEntityType(events, this.series); })); - this.actions = [...this.actionFactoryService.getSeriesActions((action: ActionItem, series: Series) => this.handleSeriesActionCallback(action, series))]; + this.actions = [...this.actionFactoryService.getSeriesActions(this.handleSeriesActionCallback.bind(this))]; if (this.isOnDeck) { const othersIndex = this.actions.findIndex(obj => obj.title === 'others'); const othersAction = deepClone(this.actions[othersIndex]) as ActionItem; @@ -207,7 +204,7 @@ export class SeriesCardComponent implements OnInit, OnChanges { action: Action.RemoveFromOnDeck, title: 'remove-from-on-deck', description: '', - callback: (action: ActionItem, series: Series) => this.handleSeriesActionCallback(action, series), + callback: this.handleSeriesActionCallback.bind(this), class: 'danger', requiresAdmin: false, requiredRoles: [],