Skip to content

Commit

Permalink
make users required!
Browse files Browse the repository at this point in the history
  • Loading branch information
awitkowski0 committed Apr 23, 2024
1 parent bdbc859 commit c1b7450
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions frontend/src/Recommendations.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,13 @@ function Recommendations({
minYear,
maxYear
}) {
const altText =
poster === "N/A" || poster == null ? "Poster for movie not found" : "";

const [loading, setLoading] = useState(false); // State to track loading status

const handleGetRecommendation = async () => {
setLoading(true); // Start loading
await getRecommendation(); // Assume getRecommendation is an async function
setLoading(false); // End loading
};
const [yearRange, setYearRange] = useState([1950, 2024]);

return (
<Box sx={{ maxWidth: 850, width: "100%" }}>
<Box
Expand Down Expand Up @@ -161,7 +156,7 @@ function Recommendations({
variant="contained"
onClick={handleGetRecommendation}
fullWidth
disabled={loading} // Disable the button when loading
disabled={loading || selectedUsers.length === 0} // Disable the button when loading
>
{loading ? <CircularProgress size={24} /> : "Get Recommendation"}
</Button>
Expand Down

0 comments on commit c1b7450

Please sign in to comment.