Skip to content

Fix development errors #1282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions components/Layout/LayoutCart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const updateCartDisplay = () => {

const remoteCartLength = data.value.cart.contents.nodes.reduce(
(total, product) => total + product.quantity,
0,
0
);

const remoteTotal = data.value.cart.contents.nodes.reduce(
Expand All @@ -83,7 +83,7 @@ const updateCartDisplay = () => {
const productTotal = Number(product.total.replace(/[^0-9.-]+/g, ""));
return total + productTotal;
},
0,
0
);

cartLength.value = remoteCartLength;
Expand Down Expand Up @@ -118,14 +118,20 @@ watch(
() => {
cartChanged.value = true;
debouncedExecute();
},
}
);

// Use a longer interval if you still want to use an interval
setInterval(() => {
if (cartChanged.value) {
cartChanged.value = false;
debouncedExecute();
}
}, 5000);
onMounted(() => {
const intervalId = setInterval(() => {
if (cartChanged.value) {
cartChanged.value = false;
debouncedExecute();
}
}, 5000);

// Clear the interval when the component is unmounted to prevent memory leaks
onBeforeUnmount(() => {
clearInterval(intervalId);
});
});
</script>
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,11 @@
"prettier": "^3.2.5",
"tailwindcss": "^3.4.1"
},
"resolutions": {
"vue": "^3.4.21",
"tslib": "2.5.1"
},
"overrides": {
"vue": "^3.3.9",
"tslib": "2.6.2"
},
"dependencies": {
"@formkit/nuxt": "^1.6.0",
"@nuxtjs/algolia": "^1.10.1",
"@pinia/nuxt": "^0.5.1",
"graphql": "^16.8.1",
"lodash": "^4.17.21",
"pinia": "^2.1.7",
"swiper": "^10.3.1",
Expand Down
38 changes: 18 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tests/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { test, expect } from "@playwright/test";

test("Has Index title", async ({ page }) => {
//await page.goto('https://playwright.dev/');
await page.goto("/");

// Expect a title "to contain" a substring.
Expand Down