Skip to content

Commit 932fb23

Browse files
committed
fix: optimize locale fallback logic by moving masterLocaleData declaration
1 parent 383a0b1 commit 932fb23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/src/services/contentful.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,8 +969,8 @@ const createLocale = async (packagePath: string, destination_stack_id: string, p
969969
}
970970
localeList[title] = newLocale;
971971
}));
972+
const masterLocaleData = Object?.values(msLocale)?.[0];
972973
for (const [key, value] of Object.entries(allLocales) ?? {}) {
973-
const masterLocaleData = Object?.values(msLocale)?.[0];
974974
if (value?.code === masterLocaleData?.fallback_locale) {
975975
allLocales[key].fallback_locale = masterLocaleData?.code
976976
}

0 commit comments

Comments
 (0)