Skip to content

Commit

Permalink
refactor: remove negation
Browse files Browse the repository at this point in the history
  • Loading branch information
sethidden committed Jun 24, 2022
1 parent 4bc3849 commit dbd15f0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/theme/modules/checkout/pages/Checkout/UserAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ export default defineComponent({
}
await (
!createUserAccount.value
? attachToCart({ email: form.value.email, cart })
: register({ user: form.value })
createUserAccount.value
? register({ user: form.value })
: attachToCart({ email: form.value.email, cart })
);
}
Expand All @@ -270,12 +270,7 @@ export default defineComponent({
});
}
if (!anyError.value) {
await mergeItem('checkout', { 'user-account': form.value });
await router.push(`${app.localePath('/checkout/shipping')}`);
reset();
isFormSubmitted.value = true;
} else {
if (anyError.value) {
sendNotification({
id: Symbol('user_form_error'),
message: app.i18n.t(anyError.value.message) as string,
Expand All @@ -284,6 +279,11 @@ export default defineComponent({
persist: false,
title: 'Error',
});
} else {
await mergeItem('checkout', { 'user-account': form.value });
await router.push(app.localeRoute({ name: 'shipping' }));
reset();
isFormSubmitted.value = true;
}
if (isRecaptchaEnabled.value) {
Expand Down

0 comments on commit dbd15f0

Please sign in to comment.