fix(note_detail): preview leaks between mermaid & SQL console

This commit is contained in:
Elian Doran 2026-01-17 20:58:26 +02:00
parent 52ed1750ac
commit 6972a4b901
No known key found for this signature in database

View File

@ -265,9 +265,13 @@ function useNoteInfo() {
const [ note, setNote ] = useState<FNote | null | undefined>();
const [ type, setType ] = useState<ExtendedNoteType>();
const [ mime, setMime ] = useState<string>();
const refreshIdRef = useRef(0);
function refresh() {
const refreshId = ++refreshIdRef.current;
getExtendedWidgetType(actualNote, noteContext).then(type => {
if (refreshId !== refreshIdRef.current) return;
setNote(actualNote);
setType(type);
setMime(actualNote?.mime);