Our application is now working pretty darn well but there's still many different things we could probably
polish up.
So I'm sure you can look at this application and find like a dozen different things so we can probably
improve.
However I don't want to sit here working on the same application forever and I'm sure you don't either.
So we're just gonna take care of one little improvement very quickly.
So here's the improvement I want to make right now when our application first loads up.
We have to sit here for just a second.
With all the section headers in place before all the content actually loads.
So I want to make sure that if we don't have anything to show here I want to just hide an entire section.
In addition you might notice that if you search for some given restaurant or some given search term
here like I'll try maybe steak in some cases we might get a restaurant category without any results.
In this case I get one for every category here but I'll try something like say fast food and hopefully
there's no like big spender fast food.
Yeah there's definitely not so in this case we don't have any results for big spender so we would probably
want to hide that entire section.
So let's figure out how to do that all right.
So I'm going to open up my results list component.
Here it is right here.
Remember this component is responsible for showing one of those sections.
So I think an easy way that we can fix up this issue of not showing a title when we don't have any data
would be to just add a very simple check to this component right above our return statement.
We could say if there are no results length so we're essentially saying here if results dot 0 or similar
result results got a bad type of there.
There we go results dot length.
If that is zero where then going to flip it over to true.
So if we don't have any results then we're just going to return.
No.
And then essentially means don't show anything at all.
So I'll save this.
And now when our application first loads up we don't see anything until we actually fetch some data.
And once again if I search for fast food I'm not going to see that big spender category at the bottom
that actually is empty.
Okay so that's pretty much it pretty darn easy fix.
I can test this out on Android really quickly as well.
Do fast food and yep get the same thing.
All right.
So very good.
Well I hope you enjoyed this application together but we've still got a lot of other stuff to work on
so let's take a quick pause right here and start working on our next app in the next video.