mirror of
https://github.com/dergigi/boris.git
synced 2025-12-25 10:34:28 +01:00
fix: update originalHtmlRef when content changes
- Remove faulty conditional that prevented HTML ref from updating - Now properly stores fresh content when switching articles - Fixes issue where articles weren't switching properly
This commit is contained in:
@@ -84,10 +84,8 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
|
||||
// Store original HTML when content changes
|
||||
useEffect(() => {
|
||||
if (!contentRef.current) return
|
||||
// Only store if we don't have it yet or content changed
|
||||
if (!originalHtmlRef.current || html) {
|
||||
originalHtmlRef.current = contentRef.current.innerHTML
|
||||
}
|
||||
// Store the fresh HTML content
|
||||
originalHtmlRef.current = contentRef.current.innerHTML
|
||||
}, [html, markdown, selectedUrl])
|
||||
|
||||
// Apply highlights after DOM is rendered
|
||||
|
||||
Reference in New Issue
Block a user