Fixes
This commit is contained in:
@@ -18,12 +18,10 @@ export default function Restaurant(props) {
|
||||
const showDishList = useSelector((state) => state.data.showDishList);
|
||||
|
||||
useEffect(() => {
|
||||
if (restaurant._id !== id) {
|
||||
dispatch(fetchRestaurant(id));
|
||||
} else {
|
||||
document.title = restaurant.name;
|
||||
}
|
||||
});
|
||||
}, [dispatch, id]);
|
||||
|
||||
if (restaurant.name) document.title = restaurant.name;
|
||||
|
||||
return (
|
||||
<div className="restaurant-container">
|
||||
@@ -74,7 +72,7 @@ export default function Restaurant(props) {
|
||||
<h3>Lunch menu ({restaurant.lunchHours})</h3>
|
||||
)}
|
||||
{!showDishList && <CircularProgress />}
|
||||
{showDishList && <LunchMenu restaurant={restaurant} />}
|
||||
{(showDishList && restaurant.lunchMenu) && <LunchMenu restaurant={restaurant} />}
|
||||
<h3>Menu</h3>
|
||||
{!showDishList && <CircularProgress />}
|
||||
{showDishList && <DishList />}
|
||||
|
||||
Reference in New Issue
Block a user