fix: critical issues - settings sync, error handling, bookmarks persistence
- Fix settings synchronization: ReadingView now listens to storage events for real-time preference updates - Add comprehensive error handling to loadChapter with proper state management - Add comprehensive error handling to loadBooks with booksLoading state - Add localStorage persistence for bookmarks (load on mount, save on change) - Display error messages in UI with reload button and proper loading states 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,14 @@ export function ReadingView({
|
||||
const [showControls, setShowControls] = useState(!isMobile)
|
||||
|
||||
useEffect(() => {
|
||||
const handleStorageChange = () => {
|
||||
setPreferences(loadPreferences())
|
||||
}
|
||||
|
||||
setPreferences(loadPreferences())
|
||||
window.addEventListener('storage', handleStorageChange)
|
||||
|
||||
return () => window.removeEventListener('storage', handleStorageChange)
|
||||
}, [])
|
||||
|
||||
const cssVars = getCSSVariables(preferences)
|
||||
|
||||
Reference in New Issue
Block a user