Fix kinda invalid syntax for catch

pull/1269/head
Lim Chee Aun 2025-10-09 18:18:25 +08:00
rodzic 95bab85fb6
commit 24c59dbd6a
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -22,7 +22,7 @@ export function refreshLocales() {
const createLocale = mem((language, options = {}) => {
try {
return new Intl.Locale(language, options);
} catch {
} catch (e) {
// Fallback to simple string splitting
// May not work properly due to how complicated this is
if (!language) return null;
@ -77,7 +77,7 @@ const _DateTimeFormat = (locale, opts) => {
try {
return new Intl.DateTimeFormat(matchedLocale, options);
} catch {
} catch (e) {
return new Intl.DateTimeFormat(undefined, options);
}
};

Wyświetl plik

@ -10,7 +10,7 @@ function _getDtfLocale() {
const dtfLocale = new Intl.DateTimeFormat().resolvedOptions().locale;
store.session.set(DTFLOCALE_CACHE_KEY, dtfLocale);
return dtfLocale;
} catch {
} catch (e) {
return null;
}
}