Normalize fetch response.

This commit is contained in:
Mike Cao committed 2025-02-05 22:02:51 -08:00
1 parent dcf0da7b14
commit 444b828bc9
5 files changed
+38 -25

No files matched your search

+1 -7
View File
@@ -20,13 +20,7 @@ export function useLocale() {
const dateLocale = getDateLocale(locale);
async function loadMessages(locale: string) {
const { ok, data } = await httpGet(
`${process.env.basePath || ''}/intl/messages/${locale}.json`,
);
if (ok) {
messages[locale] = data;
}
messages[locale] = await httpGet(`${process.env.basePath || ''}/intl/messages/${locale}.json`);
}
async function saveLocale(value: string) {