Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
subscribe(errorVisibleCategory$, ({ action, dispatch }) => {
const { errorCode } = action;
let message = 'modal.body_error';
if (errorCode === ENOTFOUND) {
message = 'category.error.not_found';
}
dispatch(showModal({
confirm: 'modal.ok',
dismiss: null,
message,
title: 'category.error.title',
}));
dispatch(historyPop());
});
subscribe(productNotFound$, ([{ action, dispatch }, { action: { productData } }]) => {
const { productId } = action;
const name = productData.id === productId ? productData.name : productId;
dispatch(showModal({
confirm: null,
dismiss: 'modal.ok',
title: 'modal.title_error',
message: 'product.no_more_found',
params: {
name,
},
}));
dispatch(historyPop());
dispatch(expireProductById(productId));
});
goBack: () => dispatch(historyPop()),
});
goBack: () => dispatch(historyPop()),
});
subscribe(errorVisibleCategory$, ({ action, dispatch }) => {
const { errorCode } = action;
let message = 'modal.body_error';
if (errorCode === ENOTFOUND) {
message = 'category.error.not_found';
}
dispatch(showModal({
confirm: 'modal.ok',
dismiss: null,
message,
title: 'category.error.title',
}));
dispatch(historyPop());
});