Misc Bugs (#510)

* Don't show bookmark context actionable for books

* Fixed an issue where when adding a collection tag, the logic wouldn't assume the tag already existed in DB and would reset it.

* After editing a series on library page, ensure we refresh collection tags.

* Reload recently added section after changing a series

* Moved all Stat logger events to Debug

* Refactored scroll logic into a single service to keep the code consistent.
This commit is contained in:
Joseph Milazzo 2021-08-19 06:50:14 -07:00 committed by GitHub
parent 914c6f9349
commit 786fa146fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 92 additions and 52 deletions

View file

@ -3,6 +3,7 @@ import { Component, HostListener, Inject, OnDestroy, OnInit, ViewChild } from '@
import { Router } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { ScrollService } from '../scroll.service';
import { UtilityService } from '../shared/_services/utility.service';
import { SearchResult } from '../_models/search-result';
import { AccountService } from '../_services/account.service';
@ -30,7 +31,7 @@ export class NavHeaderComponent implements OnInit, OnDestroy {
private readonly onDestroy = new Subject<void>();
constructor(public accountService: AccountService, private router: Router, public navService: NavService,
private libraryService: LibraryService, public imageService: ImageService, @Inject(DOCUMENT) private document: Document) { }
private libraryService: LibraryService, public imageService: ImageService, @Inject(DOCUMENT) private document: Document, private scrollService: ScrollService) { }
ngOnInit(): void {
this.navService.darkMode$.pipe(takeUntil(this.onDestroy)).subscribe(res => {
@ -46,7 +47,7 @@ export class NavHeaderComponent implements OnInit, OnDestroy {
@HostListener("window:scroll", [])
checkBackToTopNeeded() {
const offset = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
const offset = this.scrollService.scrollPosition;
if (offset > 100) {
this.backToTopNeeded = true;
} else if (offset < 40) {