Update epub last read time
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
pInputText
|
||||
[(ngModel)]="searchQuery"
|
||||
(input)="onSearchInputChange()"
|
||||
placeholder="Search books..."
|
||||
placeholder="Search books by title or author..."
|
||||
class="search-input"
|
||||
/>
|
||||
<p-button *ngIf="searchQuery" icon="pi pi-times" (click)="clearSearch()" [text]="true" [rounded]="true" class="clear-btn" aria-label="Clear Search"></p-button>
|
||||
|
||||
@@ -120,13 +120,14 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
|
||||
this.selectedFontType = individualSetting?.font || globalSetting?.font || FALLBACK_EPUB_SETTINGS.fontType;
|
||||
this.fontSize = individualSetting?.fontSize || globalSetting?.fontSize || FALLBACK_EPUB_SETTINGS.fontSize;
|
||||
}
|
||||
|
||||
|
||||
this.rendition.themes.select(this.selectedTheme);
|
||||
this.rendition.themes.fontSize(`${this.fontSize}%`);
|
||||
this.rendition.themes.font(this.selectedFontType);
|
||||
|
||||
this.setupKeyListener();
|
||||
this.trackProgress();
|
||||
this.updateLastReadTime();
|
||||
};
|
||||
|
||||
fileReader.readAsArrayBuffer(epubData);
|
||||
@@ -135,6 +136,10 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
private updateLastReadTime(): void {
|
||||
this.bookService.updateLastReadTime(this.epub.id).subscribe();
|
||||
}
|
||||
|
||||
changeThemes(): void {
|
||||
if (this.rendition) {
|
||||
console.log(this.selectedTheme)
|
||||
@@ -237,6 +242,7 @@ export class EpubViewerComponent implements OnInit, OnDestroy {
|
||||
if (this.rendition) {
|
||||
this.rendition.off('keyup', this.keyListener);
|
||||
}
|
||||
this.updateLastReadTime();
|
||||
document.removeEventListener('keyup', this.keyListener);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user