@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.
@@ -1911,12 +1911,14 @@ const initializeApp = (0,redux_toolkit_modern/* createAsyncThunk */.aw)('initial
1911
1911
  rejectWithValue
1912
1912
  }) => __awaiter(void 0, void 0, void 0, function* () {
1913
1913
  var _a, _b, _c;
1914
- const contentLocale = (_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale;
1915
- const userLocale = (_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.userLocale;
1914
+ let contentLocale = (_a = config === null || config === void 0 ? void 0 : config.context) === null || _a === void 0 ? void 0 : _a.contentLocale;
1915
+ let userLocale = (_b = config === null || config === void 0 ? void 0 : config.context) === null || _b === void 0 ? void 0 : _b.userLocale;
1916
1916
  const environment = config.api.sendEnvironment !== false ? api.getEnvironment() : config.api.sendEnvironment;
1917
1917
  try {
1918
1918
  if (api.hasConversation()) {
1919
1919
  const initialState = yield api.getConversationIntitialState();
1920
+ contentLocale = initialState.context.contentLocale || contentLocale;
1921
+ userLocale = initialState.context.userLocale || userLocale;
1920
1922
  api.sendContext(Object.assign(Object.assign({}, initialState.context), {
1921
1923
  environment
1922
1924
  }));
@@ -3763,7 +3765,9 @@ const middleware_createI18nMiddleware = ({
3763
3765
  }
3764
3766
  }
3765
3767
  if (initializeApp.fulfilled.match(action)) {
3766
- dispatch(setLocale(action.payload.contentLocale));
3768
+ if (action.payload.contentLocale) {
3769
+ dispatch(setLocale(action.payload.contentLocale));
3770
+ }
3767
3771
  return result;
3768
3772
  }
3769
3773
  if (addEvent.match(action)) {
@@ -18260,12 +18264,12 @@ const TranslationOption = ({ label, checked, description, onChange, id, itemClas
18260
18264
 
18261
18265
  const isChecked = (language, currentLocale, isOriginal) => currentLocale === language.locale || (!currentLocale && isOriginal);
18262
18266
  const TranslationOptions = ({ onChange, describedById, }) => {
18263
- const { context: { contentLocale }, } = (0,config_hooks/* useConfig */.EV)();
18267
+ const { context: { userLocale, contentLocale }, } = (0,config_hooks/* useConfig */.EV)();
18264
18268
  const { t } = (0,hooks/* useI18n */.g)();
18265
18269
  const { languages, currentLocale, enableTranslations, disableTranslations } = (0,translations_hooks/* useTranslations */.A1)();
18266
18270
  const focusSkiplinkTarget = (0,focus_helper_hooks/* useSkiplinkTargetFocusing */.e6)();
18267
18271
  const handleChange = (locale) => () => {
18268
- if (locale === currentLocale || contentLocale === locale) {
18272
+ if (locale === currentLocale || userLocale === locale) {
18269
18273
  disableTranslations();
18270
18274
  }
18271
18275
  else {