Skip to content

Commit 9f7e0ae

Browse files
authored
Merge pull request #233 from w3bdesign/dev
Add message to refresh page if we have an error
2 parents 1e7d9b2 + 2ab6288 commit 9f7e0ae

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

components/Header/Cart.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<template>
22
<div>
3-
<div v-if="!remoteError">
3+
<div v-if="remoteError">
4+
<span class="text-xl text-red-500"
5+
>Error fetching cart. Please refresh the page.</span
6+
>
7+
</div>
8+
<div v-else>
49
<NuxtLink to="/cart">
510
<transition name="cart">
611
<span
@@ -71,7 +76,7 @@ export default {
7176
// Check if we are in the browser before checking localStorage
7277
// Will refresh the page to refetch the session from WooCommerce
7378
if (process.browser && !localStorage.getItem('woo-session')) {
74-
window.location.reload(true)
79+
this.$router.push('/')
7580
}
7681
},
7782
},

0 commit comments

Comments
 (0)