Skip to content

Commit

Permalink
continue unhandled error rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
StormyFrolic committed Jul 12, 2023
1 parent 7eb9c62 commit dac2871
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/ActiveProduct/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export default function ActiveProduct({ product }) {
const params = useParams();

useEffect(() => {
if (!product) {
if (typeof product === undefined) {
console.log('\n\nNO TEST ACTIVE PRODUCT ', product);
try {
dispatch(setCurrentProduct()).then(data =>
dispatch(
Expand Down
3 changes: 2 additions & 1 deletion src/components/Categories/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export default function Categories({ testCategories }) {
const dispatch = useDispatch();

useEffect(() => {
if (!testCategories) {
if (typeof testCategories === undefined) {
console.log('\n\nNO TEST CATEGORY ', testCategories);
try {
dispatch(fetchCategories()).then(data => {
dispatch(updateCategories(data));
Expand Down
2 changes: 1 addition & 1 deletion src/components/Products/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { addToCart } from '../../redux/reducers/cart';

export default function Products({ testCategories, testProducts }) {
useEffect(() => {
if (!testProducts) {
if (typeof testProducts === undefined) {
try {
dispatch(fetchProducts()).then(data => dispatch(getProducts(data)));
} catch (error) {
Expand Down

0 comments on commit dac2871

Please sign in to comment.