Closed tonilastre closed 2 years ago
Not completely sure what's going on here. From what I understand, you're adding a callback to assign the image when it's available and also perform error handling. Maybe some comment would be more helpful.
I'm approving so it's not blocked.
Sorry, I haven't added a description. You can check it now. It is actually a decent fix :D
It fixes the following issue:
Orb knows about default style and it will check each default style when applied to new nodes. This means it will check for values in
imageUrl
andimageUrlSelected
in order to get those images in the browser cache. The problem is that the line wherenode.style.imageUrl
is set, Orb doesn't know about it, so the image is never loaded in the browser cache, not it will be rendered. So aGraph
that is connected to theImageHandler
service that fetches images is now using the node's callback in order to figure out if there are new image URLs that should be fetched. After each new image that is downloaded, Orb will callrender
on its own to rerender the image that is available in the browser cache.