fix(ui): restore frontend verification after eslint cleanup
- Reader and metadata typing: - align ebook and cbx reader event, progress, dialog, and helper types with the stricter checks surfaced by the ESLint cleanup - replace unsafe non-null assertions and broad event assumptions with guarded access in reader, metadata, and shelf flows - Template and component compatibility: - tighten menu item typing for Angular template checking and normalize overlay and card click handlers to use explicit DOM event types - repair chart, preferences, and websocket factory typings that broke standalone typecheck and production build validation - Tests: - fix the magic shelf form-array assertion so the frontend test suite compiles cleanly under the stricter checker - Validation: - `just ui check` - `just ui typecheck` - `just ui test`
This commit is contained in:
+2
-2
@@ -122,14 +122,14 @@ export class EpubReaderPreferencesComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
get selectedFont(): string | null {
|
||||
return this.userSettings.ebookReaderSetting.fontFamily;
|
||||
return this.userSettings.ebookReaderSetting.fontFamily || null;
|
||||
}
|
||||
|
||||
set selectedFont(value: string | null) {
|
||||
if (typeof value === "string") {
|
||||
this.userSettings.ebookReaderSetting.fontFamily = value;
|
||||
} else {
|
||||
this.userSettings.ebookReaderSetting.fontFamily = null;
|
||||
this.userSettings.ebookReaderSetting.fontFamily = '';
|
||||
}
|
||||
this.readerPreferencesService.updatePreference(['ebookReaderSetting', 'fontFamily'], value);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ export class ReaderPreferencesService {
|
||||
updatePreference(path: string[], value: unknown): void {
|
||||
if (!this.currentUser) return;
|
||||
|
||||
let target = this.currentUser.userSettings as MutableSettingsBranch;
|
||||
let target = this.currentUser.userSettings as unknown as MutableSettingsBranch;
|
||||
for (let i = 0; i < path.length - 1; i++) {
|
||||
const next = target[path[i]];
|
||||
if (!next || typeof next !== 'object') {
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ export class FilterPreferencesComponent {
|
||||
private updatePreference(path: string[], value: unknown): void {
|
||||
if (!this.currentUser) return;
|
||||
|
||||
let target = this.currentUser.userSettings as MutableSettingsBranch;
|
||||
let target = this.currentUser.userSettings as unknown as MutableSettingsBranch;
|
||||
for (let i = 0; i < path.length - 1; i++) {
|
||||
const next = target[path[i]];
|
||||
if (!next || typeof next !== 'object') {
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ export class SidebarSortingPreferencesComponent implements OnInit, OnDestroy {
|
||||
|
||||
private updatePreference(path: string[], value: unknown): void {
|
||||
if (!this.currentUser) return;
|
||||
let target = this.currentUser.userSettings as MutableSettingsBranch;
|
||||
let target = this.currentUser.userSettings as unknown as MutableSettingsBranch;
|
||||
for (let i = 0; i < path.length - 1; i++) {
|
||||
const next = target[path[i]];
|
||||
if (!next || typeof next !== 'object') {
|
||||
|
||||
Reference in New Issue
Block a user