Skip to content

Commit

Permalink
fix(web): force to select a product (#1307)
Browse files Browse the repository at this point in the history
Force to select a product before proceeding to the overview.
  • Loading branch information
imobachgs authored Jun 11, 2024
2 parents 82edb2d + 81cfe16 commit d4147e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/src/components/overview/OverviewPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
} from "@patternfly/react-core";
import { useProduct } from "~/context/product";
import { useInstallerClient } from "~/context/installer";
import { Navigate, Link } from "react-router-dom";
import { Link, Navigate } from "react-router-dom";
import { CardField, EmptyState, Page, InstallButton } from "~/components/core";
import L10nSection from "./L10nSection";
import StorageSection from "./StorageSection";
Expand Down Expand Up @@ -72,13 +72,18 @@ const IssuesList = ({ issues }) => {
};

export default function OverviewPage() {
const { selectedProduct } = useProduct();
const [issues, setIssues] = useState([]);
const client = useInstallerClient();

useEffect(() => {
client.issues().then(setIssues);
}, [client]);

if (selectedProduct === null) {
return <Navigate to="/products" />;
}

return (
<>
<Page.MainContent>
Expand Down

0 comments on commit d4147e0

Please sign in to comment.