File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -121,19 +121,17 @@ watch(
121121 }
122122);
123123
124- if (process .client ) {
125- onMounted (() => {
126- const intervalId = setInterval (() => {
127- if (cartChanged .value ) {
128- cartChanged .value = false ;
129- debouncedExecute ();
130- }
131- }, 5000 );
132-
133- // Clear the interval when the component is unmounted to prevent memory leaks
134- onBeforeUnmount (() => {
135- clearInterval (intervalId);
136- });
124+ onMounted (() => {
125+ const intervalId = setInterval (() => {
126+ if (cartChanged .value ) {
127+ cartChanged .value = false ;
128+ debouncedExecute ();
129+ }
130+ }, 5000 );
131+
132+ // Clear the interval when the component is unmounted to prevent memory leaks
133+ onBeforeUnmount (() => {
134+ clearInterval (intervalId);
137135 });
138- }
136+ });
139137< / script>
You can’t perform that action at this time.
0 commit comments