mirror of
https://github.com/stashapp/stash.git
synced 2025-12-30 20:30:07 +01:00
Show country flags for ISO coded countries (#2230)
This commit is contained in:
parent
7a0aa5d94a
commit
db55b1746a
1 changed files with 4 additions and 2 deletions
|
|
@ -20,8 +20,10 @@ const fuzzyDict: Record<string, string> = {
|
|||
const getISOCountry = (country: string | null | undefined) => {
|
||||
if (!country) return null;
|
||||
|
||||
const code = fuzzyDict[country] ?? Countries.getAlpha2Code(country, "en");
|
||||
if (!code) return null;
|
||||
const code =
|
||||
fuzzyDict[country] ?? Countries.getAlpha2Code(country, "en") ?? country;
|
||||
// Check if code is valid alpha2 iso
|
||||
if (!Countries.alpha2ToAlpha3(code)) return null;
|
||||
|
||||
return {
|
||||
code,
|
||||
|
|
|
|||
Loading…
Reference in a new issue