Skip to content

Commit

Permalink
console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Oct 26, 2023
1 parent f52d57d commit a4bddb0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/src/context/software.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,18 @@ function SoftwareProvider({ children }) {
console.log("Loading products");
loadProducts().catch(console.error);
}
console.log("Refreshing the software provider");
}, [client, setProducts, setSelectedId, cancellablePromise]);

useEffect(() => {
if (!client) return;

console.log("Listening for product changes");
return client.software.onProductChange(setSelectedId);
}, [client, setSelectedId]);

const value = [products, selectedId];
console.log("Injecting the value", value, "in the <SoftwareContext.Provider/>");
return <SoftwareContext.Provider value={value}>{children}</SoftwareContext.Provider>;
}

Expand All @@ -63,6 +66,7 @@ function useSoftware() {
throw new Error("useSoftware must be used within a SoftwareProvider");
}

console.log("Retrieving software value", context);
const [products, selectedId] = context;

let selectedProduct = selectedId;
Expand Down

0 comments on commit a4bddb0

Please sign in to comment.