Skip to content

Commit

Permalink
[web] Adapt changes from master
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Oct 27, 2023
1 parent 521a2ca commit adb53b7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 83 deletions.
4 changes: 2 additions & 2 deletions web/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Outlet } from "react-router-dom";

import { _ } from "~/i18n";
import { useInstallerClient, useInstallerClientStatus } from "~/context/installer";
import { useSoftware } from "./context/software";
import { useProduct } from "./context/product";
import { STARTUP, INSTALL } from "~/client/phase";
import { BUSY } from "~/client/status";

Expand Down Expand Up @@ -57,7 +57,7 @@ const ATTEMPTS = 3;
function App() {
const client = useInstallerClient();
const { attempt } = useInstallerClientStatus();
const { products } = useSoftware();
const { products } = useProduct();
const { language } = useL10n();
const [status, setStatus] = useState(undefined);
const [phase, setPhase] = useState(undefined);
Expand Down
6 changes: 3 additions & 3 deletions web/src/App.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jest.mock("~/client");

// list of available products
let mockProducts;
jest.mock("~/context/software", () => ({
...jest.requireActual("~/context/software"),
useSoftware: () => {
jest.mock("~/context/product", () => ({
...jest.requireActual("~/context/product"),
useProduct: () => {
return {
products: mockProducts,
selectedProduct: null
Expand Down
2 changes: 1 addition & 1 deletion web/src/context/product.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function useProduct() {
}

const { products = [], selectedId } = context;
const selectedProduct = products.find(p => p.id === selectedId);
const selectedProduct = products.find(p => p.id === selectedId) || null;

return { ...context, selectedProduct };
}
Expand Down
77 changes: 0 additions & 77 deletions web/src/context/software.jsx

This file was deleted.

0 comments on commit adb53b7

Please sign in to comment.