Copy link to clipboard
Copied
Hi again, I have another question!
I'm using imageChanged event (brush tool basically) in Generator to fire jsx-file with some document tweaking, the problem I have is that tweaking in jsx are also registered as imageChanged event.
Is there a nice way to ignore what's happening in jsx? (I guess timer is the worst because I'm not sure how much time will my jsx function take). Do I need to make a callback from jsx or maybe there's an event from using Brush tool?
Thanks
Copy link to clipboard
Copied
Basically you should keep track of document id's either by
Then ignore all events from documents created during your jsx
Copy link to clipboard
Copied
I'm sorry I'm not sure I follow. I'm working with one document, imageChanged event dispatches when active document changes and I want to ignore active document changes from my jsx so imageChanged wouldn't go in infinite loop
Copy link to clipboard
Copied
Not sure either anymore. My understanding was that your JSX is changing/creating docs that causes issue for your Generator plugin that would think user is doing something and would need to fire the JSX again. Because of that my suggestion was that you need logic to detect if doc changes are caused by your jsx or by the user.
But I don't understand why JSX needs to ignore active doc changes since it's the cause of the changes, right? While jsx is running, user can't change anything.