Skip to content

Commit

Permalink
fix: use language data from client response
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-zelger committed Feb 3, 2024
1 parent 36e423a commit 905f976
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ function Footer(props: Props) {
return
}

client.get('/sections?_sort=sorting:ASC&_locale=' + lang).then((response: { data: any }) => {
// const newSections = getLocalSectionData(lang)
client.get('/sections?_sort=sorting:ASC&_locale=' + lang).then((response: { data: any[] }) => {
if (currentSection) {
const otherSection = currentSection['localizations'].find((l: any) => {
return l.locale === lang
})

// @ts-ignore
const newCurrentSection = newSections.find((s: any) => {

const newCurrentSection = response.data.find((s: any) => {
return s['id'] === otherSection['id']
})

Expand Down

0 comments on commit 905f976

Please sign in to comment.