openverse-frontend
openverse-frontend copied to clipboard
Some images don't have "Related images" but the header for the section is still displayed
Problem
One of our current featured images (the one shown on the homepage) appear to have no related images after some modifications in the API endpoint (WordPress/openverse-api#865). This is likely happening with more images, so will be better to hide the header when the section is empty.
The details page of this featured image: https://search-production.openverse.engineering/image/648b566f-0228-4819-83d5-8f1d324ec06d

Alternatives
This is open to alternatives while is reworked on the API.
Implementation
- [ ] 🙋 I would be interested in implementing this feature.
Just to confirm, there are definitely no related images returned by the API endpoint, interesting:
https://api.openverse.engineering/v1/images/648b566f-0228-4819-83d5-8f1d324ec06d/related/
I wonder if it's cache related. Checking now, I can see both the frontend and the API results for this link.
Ah very strange, I can now as well. I don't think it's the cache though, because I've been testing this by appending unique query strings. Something else may be going on in the API 🤔
In any case, given that there is a possibility that we might have images that are unrelated to anything else, we should add the check to not show the heading unless there is content to go below it.
Just visited the link given in the issue, but it shows Related Images to me.

@shreyanshmalvya Yes, it was something that happened for a few moments, we need to find out why does that happen but also to hide the section when there are no related images available.
Are you interested in working on this? :)
@krysal Yes, I am, I even checked out the code to find any errors.
Hello @shreyanshmalvya do you still plan to work on this issue? Or may I take look at it?
@0kyn, it's been 2 months since @shreyanshmalvya commented. Feel free to take this up.