if (isEmpty(contactData) || isEmpty(get(contactData, 'emails'))) {
contactData = yield store.findRecord('contact', contactId);
}
if (isEmpty(contactData) || isEmpty(get(contactData, 'emails'))) {
flashMessages.danger(i18n.t('email.cpq_document_email_missing'));
return false;
}
The second block is triggered while the promise is still processing and I encounter an error. Shouldn't it pause execution until the promise is fulfilled?
The promise eventually completes successfully with no issues on subsequent runs.