0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-02 23:42:44 +00:00

"Moved and rearranged conditional statements for rendering no search/brews found messages in VaultPage component."

This commit is contained in:
Víctor Losada Hernández
2024-08-09 23:15:59 +02:00
parent ca1f2dd1c3
commit 3f9c7a1794

View File

@@ -369,14 +369,6 @@ const VaultPage = (props) => {
); );
} }
if (validateForm() && !brewCollection) {
return (
<div className="foundBrews noBrews">
<h3>No search yet</h3>
</div>
);
}
if (error) { if (error) {
console.log('render Error: ', error); console.log('render Error: ', error);
let errorMessage; let errorMessage;
@@ -403,7 +395,15 @@ const VaultPage = (props) => {
); );
} }
if (!brewCollection || brewCollection.length === 0) { if (!brewCollection) {
return (
<div className="foundBrews noBrews">
<h3>No search yet</h3>
</div>
);
}
if (brewCollection.length === 0) {
return ( return (
<div className="foundBrews noBrews"> <div className="foundBrews noBrews">
<h3>No brews found</h3> <h3>No brews found</h3>