feat: Set the browser title based on what section of the app you are on (#947)

* when reading a book, set the page title

* set page title on various sections of the app

* update page title service
This commit is contained in:
Ionuț Staicu
2025-10-31 10:31:30 -06:00
committed by GitHub
parent d542c87afb
commit db9bc40960
10 changed files with 77 additions and 5 deletions
@@ -1,5 +1,6 @@
import {Component, HostListener, inject, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {PageTitleService} from "../../../shared/service/page-title.service";
import {CbxReaderService} from '../../book/service/cbx-reader.service';
import {BookService} from '../../book/service/book.service';
import {
@@ -49,6 +50,7 @@ export class CbxReaderComponent implements OnInit {
private bookService = inject(BookService);
private userService = inject(UserService);
private messageService = inject(MessageService);
private pageTitle = inject(PageTitleService);
showFitModeDropdown: boolean = false;
@@ -93,6 +95,8 @@ export class CbxReaderComponent implements OnInit {
const userSettings = myself.userSettings;
this.bookType = book.bookType;
this.pageTitle.setBookPageTitle(book);
const pagesObservable = this.bookType === CbxReaderComponent.TYPE_PDF
? this.pdfReaderService.getAvailablePages(this.bookId)
: this.cbxReaderService.getAvailablePages(this.bookId);