Add persistent flag of origin
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 1m12s

This commit is contained in:
Ahmed Al-Taiar
2024-10-17 21:36:50 -04:00
parent cbf75acbeb
commit f8987b08da
11 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import { hasFlag } from 'country-flag-icons'
import { hydrateRoot, createRoot } from 'react-dom/client'
import App from 'src/App'
@ -15,6 +16,11 @@ if (!redwoodAppElement)
"exists in your 'web/src/index.html' file."
)
if (!hasFlag(process.env.COUNTRY))
throw new Error(
'Invalid COUNTRY environment variable, please select a valid ISO-3166-1 alpha-2 country code\n See https://en.wikipedia.org/wiki/ISO_3166-1#Codes'
)
if (redwoodAppElement.children?.length > 0)
hydrateRoot(redwoodAppElement, <App />)
else {