mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 09:19:56 -05:00
[V1] Fixed Downloader Pause/Clear & Began Revision #1 Bug Fixes
This commit is contained in:
+3
-2
@@ -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) };
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user