mirror of
https://github.com/priyanshujain/margin.git
synced 2026-10-02 11:07:04 +00:00
fix(editor): persist per-chapter cursor and scroll across restarts
Positions were kept in an in-memory Map, so they were lost on quit and the cursor jumped to the top on reopen. Store them in localStorage (keyed by book + chapter, like theme/width) and restore on app open, not just on in-session chapter switches. Also save the current chapter continuously (debounced on selection + scroll) so closing the app records where you left off, and re-apply scroll after fonts load.
This commit is contained in:
1 parent
39609fbd09
commit
8b83f80d52
3 files changed
+67
-22
No files matched your search
@@ -263,6 +263,7 @@ export function EditorView() {
|
||||
)}
|
||||
</header>
|
||||
<Editor
|
||||
bookId={book.id}
|
||||
chapterId={chapter.id}
|
||||
content={chapter.content}
|
||||
onChange={(content) => setChapterContent(chapter.id, content)}
|
||||
|
||||
Reference in new issue
Block a user