My code looks like this,
export function handleLogin(window,userData){
return (dispatch) => {
Meteor.call('checkUserLogin',userData,
(error,result)=>{
if(result.isLogin && !error) {
Meteor.call('SOMECALL',SOMEDATA (e,r)=>{
if(!e) {
async function getData(){ return await getAdminUgData();}
getData()
.then((d)=>{console.log('resolve!!');})
.catch((e)=>{console.log('!!reject'); });
}
});
});
}; }
the getAdminUgData is,
export function getAdminUgData(){
return new Promise((resolve, reject) => {
Meteor.call('adminGetUserGroupData', (e,r)=>{
if(e) reject(new Error('error'));
else resolve(r);
});
});}
I am supposed to print out 'resolve' only because the resolve(r); is confirmed being called in getAdminUgData. But the confusing/weird reality is that 'resolve!!' is printed and after that, '!!reject' is also printed. And I completely have no ideas about this. Any suggestions are welcome; thanks.