I am developing a react native project for mobile applications.
The app works fine in debug mode but doesn't work properly after I release the app with CLI.
I think the API request part in Promise.all()
inside the code below has an issue in release mode.
If anyone has faced similar problems before, then please let me know a suitable solution.
useEffect(() => {
getUserInfo('sdf').then(d => {
const userId = 'sdf';
Promise.all([
fetchPortfolio(userId, 'coin'),
fetchPortfolio(userId, 'idea'),
getCryptoNews('stocks'),
])
.then(values => {
dispatch(setCryptoPortfolio(values[0].items ? values[0].items : []));
dispatch(setIdeaPortfolio(values[1].items ? values[1].items : []));
setNewsList(values[2].slice(0, 3));
setLoading(false);
})
.catch(err => {
console.log(err);
setLoading(false);
});
});
}, []);
It executes the code inside .catch()
block of the code in release mode.