[V1] Fixed Downloader Pause/Clear & Began Revision #1 Bug Fixes

This commit is contained in:
Youwes09
2026-02-23 00:03:37 -06:00
parent 55d1431673
commit edf2af8618
12 changed files with 731 additions and 118 deletions
+3 -2
View File
@@ -59,6 +59,8 @@ export interface Settings {
keybinds: Keybinds;
storageLimitGb: number | null;
folders: Folder[];
/** Debounce delay (ms) applied to the reader's scroll/page-change handler. 0 = off. */
readerDebounceMs: number;
}
export const DEFAULT_SETTINGS: Settings = {
@@ -87,6 +89,7 @@ export const DEFAULT_SETTINGS: Settings = {
keybinds: DEFAULT_KEYBINDS,
storageLimitGb: null,
folders: [],
readerDebounceMs: 120,
};
interface Store {
@@ -166,12 +169,10 @@ export const useStore = create<Store>()(
set((s) => {
const existing = s.history.findIndex((h) => h.chapterId === entry.chapterId);
if (existing === 0) {
// Same chapter is already at the top — just update pageNumber and readAt in place
const updated = [...s.history];
updated[0] = { ...updated[0], pageNumber: entry.pageNumber, readAt: entry.readAt };
return { history: updated };
}
// New chapter or chapter not at top — remove old entry, prepend fresh
const deduped = s.history.filter((h) => h.chapterId !== entry.chapterId);
return { history: [entry, ...deduped].slice(0, 300) };
}),