if (isEmpty(contact) || isEmpty(get(contact, 'emails'))) {
contact = yield store.findRecord('contact', contactId);
}
if (isEmpty(contact) || isEmpty(get(contact, 'emails'))) {
flashMessages.danger(i18n.t('email.cpq_document_email_missing'));
return false;
}
The second block runs when the promise is running and Im getting an error. Shouldn't it stop the flow until the promise is resolved.
The promise runs fine and it works the next time
Assuming you are using
ember-data, you may be encountering a case wherefindRecordreturns a cached record. This depends on if you've already loaded the record (perhaps from a previousfindRecord,findAllorqueryon another route, and how theember-dataadapter is configured:shouldBackgroundReloadRecordandshouldBackgroundReloadAllare methods on the adapter that default to returningtrue. When those methods returntrue, the cached record is immediately returned, but the record(s) are fetched again in the "background".