kgabryje commented on PR #19993:
URL: https://github.com/apache/superset/pull/19993#issuecomment-1122337875

   Well spotted @michael-s-molina! The problem was that the cleanup function in 
use effect was being called on each change of its dependencies. I moved the 
cleanup to a separate useEffect that gets called only on unmount.
   
   Also I fixed an old bug that caused the "Altered" pill to stay visible when 
there was an adhoc metric added and then you added some metric and deleted it 
immediately (so effectively there was no change, but "Altered" stayed). The 
reason for that was that in initial form data the adhoc metric is represented 
by a  plain JSON object, but later it's transformed to AdhocMetric instance, so 
`isEqual` is false even if the field values are the same. I fixed it by 
omitting `__proto__` before calling `isEqual` so that we ignore the difference 
between plain object and class instance


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to