Skip to content

Commit f36eade

Browse files
KevinGorjanMarcin Kwiatkowski
authored andcommitted
fix: loosing data when moving between steps on the checkout (#440)
* fix(theme): prevent user to click on next steps in the checkout * feat(theme): added an asyncLocalStorage helper * fix(theme): added feature so the User Account is filled in * fix(theme): user can't go pages directly * feat(theme): a helpers for validating is the user has access to a specific step in the checkout * feat(theme): implemented the validation in the checkout steps * test: added tests for asyncLocalStorage and the steps helper
1 parent 0fc5ded commit f36eade

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/theme/pages/Checkout/Payment.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ export default defineComponent({
217217
await load();
218218
});
219219
220+
onMounted(async () => {
221+
const validStep = await isPreviousStepValid('billing');
222+
if (!validStep) {
223+
await router.push(app.localePath('/checkout/user-account'));
224+
}
225+
});
226+
220227
const processOrder = async () => {
221228
await make();
222229
setCart(null);

0 commit comments

Comments
 (0)