Pārlūkot izejas kodu

fix: locale match error (#115)

tags/0.2.2
Joel pirms 2 gadiem
vecāks
revīzija
96809108ca
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5
    1
      web/middleware.ts

+ 5
- 1
web/middleware.ts Parādīt failu

@@ -23,7 +23,11 @@ export const getLocale = (request: NextRequest): Locale => {
}

// match locale
const matchedLocale = match(languages, locales, i18n.defaultLocale) as Locale
let matchedLocale:Locale = i18n.defaultLocale
try {
// If languages is ['*'], Error would happen in match function.
matchedLocale = match(languages, locales, i18n.defaultLocale) as Locale
} catch(e) {}
return matchedLocale
}


Notiek ielāde…
Atcelt
Saglabāt