Skip to content

Commit f87bfdd

Browse files
committed
Merge branch 'master' into legacy-vite-config
2 parents c37e02c + 2450c31 commit f87bfdd

14 files changed

+97
-49
lines changed

CHANGELOG.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
# Changelog
22

3-
[Unreleased changes](https://github.com/rapidez/core/compare/4.7.1...4.7.1)
3+
[Unreleased changes](https://github.com/rapidez/core/compare/4.7.5...4.7.5)
4+
## [4.7.5](https://github.com/rapidez/core/releases/tag/4.7.5) - 2025-09-26
5+
6+
### Fixed
7+
8+
- Use npm workspaces for Rapidez dependencies (#1026)
9+
10+
## [4.7.4](https://github.com/rapidez/core/releases/tag/4.7.4) - 2025-09-26
11+
12+
### Fixed
13+
14+
- Playwright wait for footer on success page (#1024)
15+
- Package.json name and version (#1025)
16+
17+
## [4.7.3](https://github.com/rapidez/core/releases/tag/4.7.3) - 2025-09-26
18+
19+
### Fixed
20+
21+
- Playwright test fix (#1023)
22+
23+
## [4.7.2](https://github.com/rapidez/core/releases/tag/4.7.2) - 2025-09-26
24+
25+
### Fixed
26+
27+
- Slider arrows color fix (#1017)
28+
- Visual swatch filters not showing fix (#1016)
29+
- Autocomplete focus on mobile fix (#1018)
30+
- Playwright use screenshot method everywhere (#1022)
31+
- GraphQL mutation notification event fix (#1021)
32+
- Fire login event when logged in customer changes (#1019)
33+
434
## [4.7.1](https://github.com/rapidez/core/releases/tag/4.7.1) - 2025-09-18
535

636
### Fixed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"name": "@rapidez/core",
3+
"version": "1.0.0",
24
"private": true,
35
"type": "module",
46
"scripts": {
@@ -45,5 +47,8 @@
4547
"vue-turbolinks": "^2.2.2",
4648
"vue2-teleport": "^1.1.4"
4749
},
48-
"dependencies": {}
50+
"dependencies": {},
51+
"workspaces": [
52+
"vendor/rapidez/*"
53+
]
4954
}

resources/js/components/GraphqlMutation.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export default {
201201
if (this.redirect) {
202202
if (this.notify.message) {
203203
document.addEventListener(
204-
'turbo:load',
204+
'vue:loaded',
205205
() => {
206206
Notify(this.notify.message, this.notify.type ?? 'success')
207207
},

resources/js/stores/useCart.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { StorageSerializers, asyncComputed, useLocalStorage, useMemoize } from '@vueuse/core'
2-
import { computed, ref, watch } from 'vue'
2+
import { computed, watch } from 'vue'
33
import { GraphQLError } from '../fetch'
44
import { mask, clearMask } from './useMask'
55
import { user } from './useUser'
@@ -110,6 +110,14 @@ export const fetchCart = async function () {
110110
await fetchGuestCart()
111111
}
112112

113+
export const loggedIn = async function () {
114+
if (mask.value) {
115+
await linkUserToCart()
116+
} else {
117+
await fetchCustomerCart()
118+
}
119+
}
120+
113121
export const fetchAttributeValues = async function (attributes = []) {
114122
if (!attributes.length) {
115123
return { data: { customAttributeMetadataV2: { items: null } } }

resources/js/stores/useUser.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useLocalStorage, useSessionStorage, StorageSerializers } from '@vueuse/core'
22
import { useCookies } from '@vueuse/integrations/useCookies'
3-
import { clear as clearCart, fetchCustomerCart, linkUserToCart, cart } from './useCart'
3+
import { clear as clearCart, loggedIn as cartLoginHandler, cart } from './useCart'
44
import { clear as clearOrder } from './useOrder'
55
import { computed, watch } from 'vue'
66
import Jwt from '../jwt'
@@ -61,7 +61,11 @@ export const refresh = async function () {
6161

6262
return (currentRefresh = (async function () {
6363
try {
64+
const oldEmail = userStorage.value?.email
6465
userStorage.value = (await magentoGraphQL(`{ customer { ${config.queries.customer} } }`))?.data?.customer
66+
if (oldEmail !== userStorage.value?.email) {
67+
await loggedIn()
68+
}
6569
} catch (error) {
6670
if (error instanceof SessionExpired) {
6771
await clear()
@@ -141,14 +145,12 @@ export const login = async function (email, password) {
141145

142146
export const loginByToken = async function (customerToken) {
143147
token.value = customerToken
148+
await refresh()
149+
}
144150

145-
if (mask.value) {
146-
await linkUserToCart()
147-
} else {
148-
await fetchCustomerCart()
149-
}
150-
151+
export const loggedIn = async function () {
151152
window.app.$emit('logged-in')
153+
await cartLoginHandler()
152154
}
153155

154156
export const logout = async function () {
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)