You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only retrieve cached projects for the current locale (#1342)
## Changes
### Locale switching fix
- Before: caching wasn't working properly, hence the editor-standalone
not behaving consistently and the CCP broken with locale switching (see
https://www.figma.com/board/21lOTDiDkQ0cdUNF2fpnZh/Editor-behaviour-on-locale-change?node-id=0-1&p=f&t=osxIb33Az8NX4iqL-0)
- Added a locale match check before loading a cached project in
`useProject` hook
- **This is a temporary fix as it effectively disables caching.**
- Both editor-standalone and projects-ui behave in the same way after
this change.
- Updated existing caching-related tests in `useProject.test`
### Initial load problem fix
- Before: when an editor page with locales other than en was first
loaded in CCP, it rendered en page rather than the locale page
(editor-standalone was fine)
- Updated to make sure initial attributes like locale are passed to
React by reading them from the DOM in `reactProps()` of
`web-component.js`
- This is so that the first render uses the host's value even when
`attributeChangedCallback` hasn't been run yet
0 commit comments