From 272d7673cebf5ef19d493e9bf0094802985911e3 Mon Sep 17 00:00:00 2001 From: Youwes09 Date: Thu, 26 Feb 2026 21:05:24 -0600 Subject: [PATCH] [V1] Fix NixOS Build --- src-tauri/src/lib.rs | 2 +- src/components/pages/Reader.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index a042994..6ae4bef 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -157,7 +157,7 @@ fn patch_conf_key(mut text: String, key: &str, value: &str) -> String { let replacement = format!("{key} = {value}"); // Find a line that starts with the key (tolerant of surrounding whitespace) if let Some(pos) = text.lines().position(|l| l.trim_start().starts_with(key)) { - let mut lines: Vec<&str> = text.lines().collect(); + let lines: Vec<&str> = text.lines().collect(); // We need an owned replacement; rebuild from scratch. let owned: Vec = lines .iter() diff --git a/src/components/pages/Reader.tsx b/src/components/pages/Reader.tsx index 66cf874..f995c7a 100644 --- a/src/components/pages/Reader.tsx +++ b/src/components/pages/Reader.tsx @@ -10,7 +10,7 @@ import { ENQUEUE_DOWNLOAD, ENQUEUE_CHAPTERS_DOWNLOAD, } from "../../lib/queries"; import { useStore, type FitMode } from "../../store"; -import { matchesKeybind, toggleFullscreen } from "../../lib/keybinds"; +import { matchesKeybind, toggleFullscreen, DEFAULT_KEYBINDS, type Keybinds } from "../../lib/keybinds"; import s from "./Reader.module.css"; // ── Page cache (module-level, survives re-renders) ──────────────────────────── @@ -75,7 +75,7 @@ function decodeImage(url: string): Promise { return new Promise((resolve) => { const img = new Image(); img.onload = () => { img.decode ? img.decode().then(resolve, resolve) : resolve(); }; - img.onerror = resolve; + img.onerror = () => resolve(); img.src = url; }); } @@ -638,7 +638,7 @@ export default function Reader() { useEffect(() => { const onKey = (e: KeyboardEvent) => { if ((e.target as HTMLElement).tagName === "INPUT") return; - const kb = settingsRef.current?.keybinds ?? {}; + const kb: Keybinds = settingsRef.current?.keybinds ?? DEFAULT_KEYBINDS; const maxW = settingsRef.current?.maxPageWidth ?? 900; const rtl = settingsRef.current?.readingDirection === "rtl";