Fix implicit profiles being created when opening a reader

- Fix default profiles not being marked as such when creating an account
- Mention that no implicit profiles are created for pdfs
This commit is contained in:
Amelia 2025-06-01 15:21:01 +02:00
parent a67e15bbb3
commit 643c499f16
5 changed files with 20 additions and 14 deletions

View file

@ -10,7 +10,7 @@ import {
Output
} from '@angular/core';
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
import { take } from 'rxjs';
import {skip, take} from 'rxjs';
import { BookPageLayoutMode } from 'src/app/_models/readers/book-page-layout-mode';
import { BookTheme } from 'src/app/_models/preferences/book-theme';
import { ReadingDirection } from 'src/app/_models/preferences/reading-direction';
@ -210,7 +210,7 @@ export class ReaderSettingsComponent implements OnInit {
this.setupSettings();
this.setTheme(this.readingProfile.bookReaderThemeName || this.themeService.defaultBookTheme);
this.setTheme(this.readingProfile.bookReaderThemeName || this.themeService.defaultBookTheme, false);
this.cdRef.markForCheck();
// Emit first time so book reader gets the setting
@ -288,6 +288,7 @@ export class ReaderSettingsComponent implements OnInit {
this.settingsForm.valueChanges.pipe(
debounceTime(300),
distinctUntilChanged(),
skip(1), // Skip the initial creation of the form, we do not want an implicit profile of this snapshot
takeUntilDestroyed(this.destroyRef),
tap(_ => this.updateImplicit())
).subscribe();
@ -346,12 +347,15 @@ export class ReaderSettingsComponent implements OnInit {
};
}
setTheme(themeName: string) {
setTheme(themeName: string, update: boolean = true) {
const theme = this.themes.find(t => t.name === themeName);
this.activeTheme = theme;
this.cdRef.markForCheck();
this.colorThemeUpdate.emit(theme);
this.updateImplicit();
if (update) {
this.updateImplicit();
}
}
toggleReadingDirection() {

View file

@ -25,6 +25,7 @@ import {
merge,
Observable,
ReplaySubject,
skip,
Subject,
take,
tap
@ -616,11 +617,11 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.init();
// TODO: Fix this, it's going off way too often
// Update implicit reading profile while changing settings
this.generalSettingsForm.valueChanges.pipe(
debounceTime(300),
distinctUntilChanged(),
skip(1), // Skip the initial creation of the form, we do not want an implicit profile of this snapshot
takeUntilDestroyed(this.destroyRef),
map(_ => this.packReadingProfile()),
distinctUntilChanged(),
@ -821,7 +822,9 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
disableDoubleRendererIfScreenTooSmall() {
if (window.innerWidth > window.innerHeight) {
this.generalSettingsForm.get('layoutMode')?.enable();
if (this.generalSettingsForm.get('layoutMode')?.disabled) {
this.generalSettingsForm.get('layoutMode')?.enable();
}
this.cdRef.markForCheck();
return;
}

View file

@ -2803,7 +2803,7 @@
"manage-reading-profiles": {
"description": "Not all your series may be read in the same way, set up distinct reading profiles per library or series to make getting back in your series as seamless as possible.",
"extra-tip": "Assign reading profiles via the action menu on series and libraries, or in bulk. When changing settings in a reader, a hidden profile is created that remembers your choices for that series. This profile is removed when you assign or update one of your own reading profiles to the series.",
"extra-tip": "Assign reading profiles via the action menu on series and libraries, or in bulk. When changing settings in a reader, a hidden profile is created that remembers your choices for that series (not for pdfs). This profile is removed when you assign or update one of your own reading profiles to the series.",
"profiles-title": "Your reading profiles",
"default-profile": "Default",
"add": "{{common.add}}",