Skip to content
Snippets Groups Projects
Commit 8bdfc899 authored by David Bühler's avatar David Bühler
Browse files

[ivette] AST view: removes the buffer effect handler in the useEffect cleanup.

parent 4fdb0861
No related branches found
No related tags found
No related merge requests found
......@@ -130,10 +130,9 @@ const ASTview = () => {
const propertyStatus = States.useSyncArray(Properties.status).getArray();
const statusDict = States.useTags(Properties.propStatusTags);
const [edited, setEdited] = React.useState(false);
React.useEffect(() => {
if (edited && theFunction) {
const setBullets = React.useCallback(() => {
if (theFunction) {
propertyStatus.forEach((prop) => {
if (prop.function === theFunction) {
const status = statusDict.get(prop.status);
......@@ -150,11 +149,12 @@ const ASTview = () => {
}
});
}
}, [buffer, edited, theFunction, propertyStatus, statusDict]);
}, [buffer, theFunction, propertyStatus, statusDict]);
React.useEffect(() => {
buffer.on('edited', () => { setEdited(false); setEdited(true); });
}, [buffer]);
buffer.on('change', setBullets);
return () => { buffer.off('change', setBullets); };
}, [buffer, setBullets]);
// Hook: async loading
React.useEffect(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment