fix node def selected state

This commit is contained in:
codetypes committed 2025-03-22 08:11:55 +08:00
1 parent 600191eae8
commit eba675b0ab
3 files changed
+15 -16

No files matched your search

+5 -12
View File
@@ -100,12 +100,7 @@ const isTreeUpdated = (editor: EditorStore, editTree: EditTree) => {
const isSubtreeUpdated = (data: TreeGraphData) => {
if (data.path) {
try {
const subtreePath = useWorkspace.getState().workdir + "/" + data.path;
if (fs.statSync(subtreePath).mtimeMs !== data.lastModified) {
return true;
}
} catch (error) {
if (b3util.files[data.path] !== data.lastModified) {
return true;
}
}
@@ -488,12 +483,10 @@ export const Editor: FC<EditorProps> = ({ onUpdate: updateState, data: editor, .
};
const checkSubtree = () => {
if (editor.graph) {
if (isSubtreeUpdated(editor.root)) {
refresh();
pushHistory();
onChange();
}
if (editor.graph && isSubtreeUpdated(editor.root)) {
refresh();
pushHistory();
onChange();
}
};