Only render tree when locale has finished loading

This commit is contained in:
Misode
2021-09-25 17:22:25 +02:00
parent 2cb14a2c10
commit e239e013c6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ import { cleanUrl } from './Utils'
const VERSIONS_IN_TITLE = 3
function Main() {
const [lang, setLanguage] = useState<string>('en')
const [lang, setLanguage] = useState<string>('none')
const changeLanguage = async (language: string) => {
if (!Locales[language]) {
await loadLocale(language)
+1 -1
View File
@@ -12,7 +12,7 @@ type TreePanelProps = {
onError: (message: string) => unknown,
}
export function Tree({ lang, model, blockStates, onError }: TreePanelProps) {
if (!model || !blockStates) return <></>
if (!model || !blockStates || lang === 'none') return <></>
const [error] = useErrorBoundary(e => {
onError(`Error rendering the tree: ${e.message}`)