mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-19 18:45:15 +02:00
fix(citation-panel): reset expanded state when chunkId changes
CitationPanelContent uses a single instance across different citations (RightPanel.tsx:251 renders without a key), so when the user clicks a new citation while the panel is open, the prior expanded state leaks into the new citation. The reset effect had an empty dependency array, so it only fired on mount. Add chunkId to the effect deps so the expanded state resets each time the citation changes.
This commit is contained in:
parent
8fc4b98593
commit
047871c47a
1 changed files with 1 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ export const CitationPanelContent: FC<CitationPanelContentProps> = ({ chunkId, o
|
|||
|
||||
useEffect(() => {
|
||||
setExpanded(false);
|
||||
}, []);
|
||||
}, [chunkId]);
|
||||
|
||||
const chunkWindow = expanded ? EXPANDED_CHUNK_WINDOW : DEFAULT_CHUNK_WINDOW;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue