Skip to content

Commit

Permalink
Merge branch 'main' into stripe_payment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexookah committed Jul 31, 2024
2 parents f2fd009 + 38868af commit 74452f7
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 44 deletions.
56 changes: 28 additions & 28 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"@vueuse/core": "^10.11.0"
},
"devDependencies": {
"@nuxt/icon": "^1.2.1",
"@nuxt/icon": "^1.4.3",
"@nuxt/image": "1.7.0",
"@nuxtjs/i18n": "^8.3.1",
"@nuxtjs/i18n": "^8.3.3",
"@nuxtjs/tailwindcss": "^6.12.1",
"@tailwindcss/typography": "^0.5.13",
"nuxt": "^3.12.4",
"nuxt-graphql-client": "^0.2.35",
"nuxt-graphql-client": "^0.2.36",
"prettier": "^3.3.3",
"woonuxt-settings": "^1.0.58"
},
Expand Down
1 change: 1 addition & 0 deletions woonuxt_base/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineAppConfig({
showMoveToWishlist: true,
hideBillingAddressForVirtualProducts: false,
stripePaymentMethod: 'card', // 'card' || 'payment' -> ( 'card': shows CardElement, 'payment': shows payment tabs from stripe )
initStoreOnUserActionToReduceServerLoad: true,
saleBadge: 'percent', // 'percent', 'onSale' or 'hidden'
},
});
18 changes: 13 additions & 5 deletions woonuxt_base/app/plugins/init.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default defineNuxtPlugin(async (nuxtApp) => {
if (!import.meta.env.SSR) {
const { storeSettings } = useAppConfig();
const { clearAllCookies, clearAllLocalStorage } = useHelpers();
const sessionToken = useCookie('woocommerce-session');
if (sessionToken.value) useGqlHeaders({ 'woocommerce-session': `Session ${sessionToken.value}` });
Expand Down Expand Up @@ -51,11 +52,18 @@ export default defineNuxtPlugin(async (nuxtApp) => {
}
}

eventsToFireOn.forEach((event) => {
window.addEventListener(event, initStore, { once: true });
});

// If we are in development mode, we want to initialise the store immediately
if (process.env.NODE_ENV === 'development') initStore();
if (process.env.NODE_ENV === 'development') {
initStore();
return;
}

if (storeSettings.initStoreOnUserActionToReduceServerLoad) {
eventsToFireOn.forEach((event) => {
window.addEventListener(event, initStore, { once: true });
});
} else {
initStore();
}
}
});
8 changes: 1 addition & 7 deletions woonuxt_base/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default defineNuxtConfig({
htmlAttrs: { lang: 'en' },
link: [{ rel: 'icon', href: '/logo.svg', type: 'image/svg+xml' }],
},
pageTransition: { name: 'page', mode: 'out-in' },
pageTransition: { name: 'page', mode: 'default' },
},

experimental: {
Expand Down Expand Up @@ -62,12 +62,6 @@ export default defineNuxtConfig({
},
},

// if nuxt generated this is needed
// https://github.com/nuxt/icon/issues/179#issuecomment-2230860618
icon: {
provider: 'iconify'
},

// Multilingual support
i18n: {
locales: [
Expand Down
2 changes: 1 addition & 1 deletion woonuxt_base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "woonuxt",
"version": "4.0.16",
"version": "4.0.17",
"main": "./nuxt.config.ts",
"type": "module"
}

0 comments on commit 74452f7

Please sign in to comment.