@seamly/web-ui 23.0.0-alpha.1 → 23.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/lib/components.js +9 -5
- package/build/dist/lib/components.js.map +1 -1
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.map +1 -1
- package/build/dist/lib/hooks.js +7 -3
- package/build/dist/lib/hooks.js.map +1 -1
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/hooks.min.js.map +1 -1
- package/build/dist/lib/index.debug.js +4 -4
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +10 -6
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +10 -6
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +10 -6
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/utils.js +10 -6
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
- package/src/javascripts/domains/app/actions.ts +5 -2
- package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +2 -2
- package/src/javascripts/domains/translations/middleware.ts +3 -1
package/package.json
CHANGED
|
@@ -19,8 +19,8 @@ export const initializeApp = createAsyncThunk<
|
|
|
19
19
|
void,
|
|
20
20
|
ThunkAPI
|
|
21
21
|
>('initializeApp', async (_, { extra: { api, config }, rejectWithValue }) => {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
let contentLocale = config?.context?.contentLocale
|
|
23
|
+
let userLocale = config?.context?.userLocale
|
|
24
24
|
|
|
25
25
|
const environment =
|
|
26
26
|
config.api.sendEnvironment !== false
|
|
@@ -31,6 +31,9 @@ export const initializeApp = createAsyncThunk<
|
|
|
31
31
|
if (api.hasConversation()) {
|
|
32
32
|
const initialState = await api.getConversationIntitialState()
|
|
33
33
|
|
|
34
|
+
contentLocale = initialState.context.contentLocale || contentLocale
|
|
35
|
+
userLocale = initialState.context.userLocale || userLocale
|
|
36
|
+
|
|
34
37
|
api.sendContext({ ...initialState.context, environment })
|
|
35
38
|
return { initialState, contentLocale, userLocale, config }
|
|
36
39
|
} else {
|
package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx
CHANGED
|
@@ -20,7 +20,7 @@ const TranslationOptions: FC<TranslationOptionsProps> = ({
|
|
|
20
20
|
describedById,
|
|
21
21
|
}) => {
|
|
22
22
|
const {
|
|
23
|
-
context: { contentLocale },
|
|
23
|
+
context: { userLocale, contentLocale },
|
|
24
24
|
} = useConfig()
|
|
25
25
|
|
|
26
26
|
const { t } = useI18n()
|
|
@@ -29,7 +29,7 @@ const TranslationOptions: FC<TranslationOptionsProps> = ({
|
|
|
29
29
|
const focusSkiplinkTarget = useSkiplinkTargetFocusing()
|
|
30
30
|
|
|
31
31
|
const handleChange = (locale: Language['locale']) => () => {
|
|
32
|
-
if (locale === currentLocale ||
|
|
32
|
+
if (locale === currentLocale || userLocale === locale) {
|
|
33
33
|
disableTranslations()
|
|
34
34
|
} else {
|
|
35
35
|
enableTranslations(locale)
|
|
@@ -34,7 +34,9 @@ const createI18nMiddleware: Middleware<{}, RootState, any> = ({
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if (initializeApp.fulfilled.match(action)) {
|
|
37
|
-
|
|
37
|
+
if (action.payload.contentLocale) {
|
|
38
|
+
dispatch(setLocale(action.payload.contentLocale))
|
|
39
|
+
}
|
|
38
40
|
return result
|
|
39
41
|
}
|
|
40
42
|
|