File tree Expand file tree Collapse file tree 4 files changed +3660
-5924
lines changed
Expand file tree Collapse file tree 4 files changed +3660
-5924
lines changed Original file line number Diff line number Diff line change 1+ /* eslint-disable no-console */
12<template >
23 <div >
34 <LoadingSpinner v-if =" loading" />
@@ -90,6 +91,10 @@ export default {
9091 },
9192 error (error ) {
9293 this .remoteError = error
94+ // Logs out an error in the console if we are in development mode
95+ if (process .env .NODE_ENV === ' development' ) {
96+ console .error (error)
97+ }
9398 },
9499 },
95100 },
Original file line number Diff line number Diff line change @@ -63,7 +63,13 @@ export default {
6363 },
6464 error (error ) {
6565 this .remoteError = error
66- if (! localStorage .getItem (' woo-session' )) {
66+ // Logs out an error in the console if we are in development mode
67+ if (process .env .NODE_ENV === ' development' ) {
68+ console .error (error)
69+ }
70+ // Check if we are in the browser before checking localStorage
71+ // Will refresh the page to refetch the session from WooCommerce
72+ if (process .browser && ! localStorage .getItem (' woo-session' )) {
6773 window .location .reload (true )
6874 }
6975 },
You can’t perform that action at this time.
0 commit comments