Skip to content

Commit

Permalink
chore: ContactInfo error verification order
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Nov 11, 2024
1 parent 1a646f7 commit d4906ee
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ const ContactContextualBar = () => {

const handleCancel = () => contactId && directoryRoute.push({ tab: 'contacts', context: 'details', id: contactId });

if (!contactId) {
return <ContactInfoError onClose={handleClose} />;
}

if (context === 'edit' && contactId) {
return <EditContactInfoWithData id={contactId} onClose={handleClose} onCancel={handleCancel} />;
}

if (context === 'new') {
if (context === 'new' && !contactId) {
return <EditContactInfo onClose={handleClose} onCancel={handleClose} />;
}

if (!contactId) {
return <ContactInfoError onClose={handleClose} />;
}

return <ContactInfo id={contactId} onClose={handleClose} />;
};

Expand Down

0 comments on commit d4906ee

Please sign in to comment.