Normalize fetch response.
This commit is contained in:
1 parent
dcf0da7b14
commit
444b828bc9
5 files changed
+38
-25
No files matched your search
@@ -10,7 +10,7 @@ export function useLanguageNames(locale) {
|
||||
const [list, setList] = useState(languageNames[locale] || enUS);
|
||||
|
||||
async function loadData(locale) {
|
||||
const { data } = await httpGet(`${process.env.basePath || ''}/intl/language/${locale}.json`);
|
||||
const data = await httpGet(`${process.env.basePath || ''}/intl/language/${locale}.json`);
|
||||
|
||||
if (data) {
|
||||
languageNames[locale] = data;
|
||||
|
||||
Reference in new issue
Block a user