fix node def selected state
This commit is contained in:
1 parent
600191eae8
commit
eba675b0ab
3 files changed
+15
-16
No files matched your search
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user