From 12b30eba6d8026af2bda88b4e999e4c61ca7cf48 Mon Sep 17 00:00:00 2001 From: abocsan-plenty <129151096+abocsan-plenty@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:30:06 +0200 Subject: [PATCH] feat: cookie scripts refactor --- apps/web/cookie-scripts.config.ts | 15 ++++----------- apps/web/cookie.config.ts | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/apps/web/cookie-scripts.config.ts b/apps/web/cookie-scripts.config.ts index 44ac9bcb4..2b5c5d7ea 100644 --- a/apps/web/cookie-scripts.config.ts +++ b/apps/web/cookie-scripts.config.ts @@ -1,15 +1,8 @@ -import { cartGetters } from '@plentymarkets/shop-sdk'; - -const loadPaypalScript = async () => { - const { loadScript } = usePayPal(); - const { data: cart } = useCart(); - - const currency = computed(() => cartGetters.getCurrency(cart.value) || (useAppConfig().fallbackCurrency as string)); - const paypal = await loadScript(currency.value); - - console.log('works: ', paypal); +const loadExampleScript = async () => { + // eslint-disable-next-line no-console + console.log('This is an example.'); }; export default { - loadPaypalScript, + loadExampleScript, }; diff --git a/apps/web/cookie.config.ts b/apps/web/cookie.config.ts index 67d82f072..8cf75713e 100644 --- a/apps/web/cookie.config.ts +++ b/apps/web/cookie.config.ts @@ -78,7 +78,7 @@ export default { Status: 'Example cookie that loads a hello world script if accepted.', PrivacyPolicy: '/PrivacyPolicy', Lifespan: 'Session', - script: ['loadPaypalScript'], + script: ['loadExampleScript'], }, ], },