fix: keep reading bookmarks bound to route

This commit is contained in:
kuyua9
2026-05-12 18:10:42 +08:00
parent 6517eeb1a2
commit e2c9e0f06d
3 changed files with 93 additions and 22 deletions
@@ -27,6 +27,24 @@ export const createReadingBookmark = ({
updatedAt: now()
})
export const createReadingBookmarkSnapshot = ({
path,
getTitle = () => '',
getSection = () => '',
getScrollY = () => 0,
getProgress = () => 0,
now = () => Date.now()
}) =>
createReadingBookmark({
path,
title: getTitle(),
section: getSection(),
scrollY: getScrollY(),
progress: getProgress(),
now
})
const normalizeBookmark = (
value,
expectedPath,