I can’t seem to get my head around the logic for this one…
My users can add new listings with the option to include up to 4 images.
When the user is adding a new listing, I have made it possible for them to reset the inputs of the PictureUploaders by adding an ‘x’ icon:
That’s the easy part
Where it gets confusing (for me) is when the user edits an existing listing, because then any of the 4 images could be coming from 2 different sources:
- A new image uploaded via the PictureUploader
- A dynamic image from when the user previously added/edited a new listing
So… I need to be able to detect whether an image is from the database or uploaded via the PictureUploader and show the correct delete button for each scenario.
Can anyone help?