added try catch as this call fails locally (#995)

This commit is contained in:
Erik Jan de Wit 2021-08-12 10:56:25 +02:00 committed by GitHub
parent 5af816d369
commit 6f29839b06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,14 +73,15 @@ export const LocalizationTab = ({
});
const loader = async () => {
if (realm) {
try {
const result = await adminClient.realms.getRealmLocalizationTexts({
realm: realm.realm!,
selectedLocale: getValues("defaultLocale") || "en",
});
return Object.keys(result).map((key) => [key, result[key]]);
} catch (error) {
return [[]];
}
return [[]];
};
const handleModalToggle = () => {