Fixed access issues around new Authorize scheme. (#1417)

This commit is contained in:
Joseph Milazzo 2022-08-08 17:00:10 -05:00 committed by GitHub
parent f406a533d9
commit 1ee6c3e506
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 8 deletions

View file

@ -1,4 +1,4 @@
<div class="{{theme}}">
<div class="{{theme}}" *ngIf="accountService.currentUser$ | async as user">
<ng-container *ngIf="isLoading">
<div class="loading mx-auto" style="min-width: 200px; width: 600px;">
@ -14,9 +14,10 @@
<ngx-extended-pdf-viewer
#pdfViewer
[src]="readerService.downloadPdf(this.chapterId)"
[authorization]="'Bearer ' + user.token"
height="100vh"
[(page)]="currentPage"
[textLayer]="true"
[textLayer]="true"
[useBrowserLocale]="false"
[showHandToolButton]="true"
[showOpenFileButton]="false"
@ -27,7 +28,7 @@
[showPropertiesButton]="false"
[(zoom)]="zoomSetting"
[showSecondaryToolbarButton]="true"
[showBorders]="true"
[theme]="theme"
[formTheme]="theme"
@ -38,8 +39,8 @@
(pdfLoadingStarts)="updateLoading(true)"
(pdfLoaded)="updateLoading(false)"
(progress)="updateLoadProgress($event)"
>
>
</ngx-extended-pdf-viewer>
<ng-template #multiToolbar>
@ -78,12 +79,12 @@
<i class="toolbar-icon fa-solid {{this.theme === 'light' ? 'fa-sun' : 'fa-moon'}}" [ngStyle]="{color: fontColor}" aria-hidden="true"></i>
<span class="visually-hidden">{{this.theme === 'light' ? 'Light Theme' : 'Dark Theme'}}</span>
</button>
<button class="btn btn-icon col-2 col-xs-1 toolbarButton" (click)="closeReader()">
<i class="toolbar-icon fa fa-times-circle" aria-hidden="true" [ngStyle]="{color: fontColor}"></i>
<span class="visually-hidden">Close Reader</span>
</button>
<div class="verticalToolbarSeparator hiddenSmallView"></div>
<pdf-toggle-secondary-toolbar></pdf-toggle-secondary-toolbar>
</div>

View file

@ -77,7 +77,7 @@ export class PdfReaderComponent implements OnInit, OnDestroy {
private readonly onDestroy = new Subject<void>();
constructor(private route: ActivatedRoute, private router: Router, private accountService: AccountService,
constructor(private route: ActivatedRoute, private router: Router, public accountService: AccountService,
private seriesService: SeriesService, public readerService: ReaderService,
private navService: NavService, private toastr: ToastrService,
private bookService: BookService, private themeService: ThemeService,