Skip to content

Commit

Permalink
fix: APP-487 sanity localized data fallback (#2552)
Browse files Browse the repository at this point in the history
  • Loading branch information
flagrede authored Nov 21, 2024
1 parent 150bd0f commit 15d90c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions web-marketplace/src/utils/sanity/getLocalizedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ type Params = {

export const getLocalizedData = ({ data, languageCode }: Params) => {
const localizedData = data.filter(data => data.language === languageCode);
const defaultData = data.filter(data => !data.language);

return localizedData.length > 0 ? localizedData : defaultData;
return localizedData.length > 0 ? localizedData : data;
};

0 comments on commit 15d90c3

Please sign in to comment.