change detector is stupid

This commit is contained in:
Dan Percic 2022-03-07 11:56:32 +02:00
parent 5129c0628a
commit 3382f4fa09
3 changed files with 9 additions and 6 deletions

View File

@ -12,7 +12,7 @@
<div *ngIf="activeSelection" class="dot"></div>
<div *ngIf="isRotated$ | async" class="rotated">
<div *ngIf="isRotated" class="rotated">
<mat-icon svgIcon="red:rotation"></mat-icon>
</div>
</div>

View File

@ -15,7 +15,7 @@ import { ViewedPagesService } from '@services/entity-services/viewed-pages.servi
import { IViewedPage } from '@red/domain';
import { AutoUnsubscribe } from '@iqser/common-ui';
import { FilePreviewStateService } from '../../services/file-preview-state.service';
import { firstValueFrom, Observable } from 'rxjs';
import { firstValueFrom } from 'rxjs';
import { PageRotationService } from '../../services/page-rotation.service';
@Component({
@ -35,7 +35,7 @@ export class PageIndicatorComponent extends AutoUnsubscribe implements OnDestroy
pageReadTimeout: number = null;
read = false;
isRotated$: Observable<boolean>;
isRotated = false;
constructor(
private readonly _viewedPagesService: ViewedPagesService,
@ -43,7 +43,7 @@ export class PageIndicatorComponent extends AutoUnsubscribe implements OnDestroy
private readonly _changeDetectorRef: ChangeDetectorRef,
private readonly _permissionService: PermissionsService,
private readonly _stateService: FilePreviewStateService,
private readonly _pageRotationService: PageRotationService,
readonly pageRotationService: PageRotationService,
) {
super();
}
@ -61,7 +61,10 @@ export class PageIndicatorComponent extends AutoUnsubscribe implements OnDestroy
}
ngOnInit() {
this.isRotated$ = this._pageRotationService.isRotated(this.number);
this.addSubscription = this.pageRotationService.isRotated(this.number).subscribe(value => {
this.isRotated = value;
this._changeDetectorRef.detectChanges();
});
}
ngOnChanges() {

@ -1 +1 @@
Subproject commit f7f0bb86a6ccf3b6e1970c8749b83e828578e673
Subproject commit 2bae4da2b991ad300b893f6b73797b6c1b90448c