Skip to content

Commit

Permalink
feat: added check for live copies
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabhsircar11 committed Dec 19, 2024
1 parent ac34c5a commit d8dfa62
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libs/blocks/locui-create/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,21 @@ export function setSelectedLocalesAndRegions() {
const activeLocales = {};
languages.forEach((loc) => {
const { language, locales } = loc;
const { livecopies = '' } = localeByLanguage[language] || {};
const { livecopies } = localeByLanguage[language] || {};
const livecopiesArr = [];
if (livecopies) {
livecopiesArr.push(...livecopies.split(''));
}
if (locales.length > 0) {
locales.forEach((locale) => {
activeLocales[locale] = language;
});
} else {
livecopies.split(',').forEach((liveCopy) => {
livecopiesArr.forEach((liveCopy) => {
activeLocales[liveCopy] = language;
});
}
selectedLocale.push(...livecopies.split(','));
selectedLocale.push(...livecopiesArr);
});
selectedLocale.sort((a, b) => a.localeCompare(b));
locSelected.value = { selectedLocale, activeLocales };
Expand Down

0 comments on commit d8dfa62

Please sign in to comment.