fix(i18n): localize admin recovery states
This commit is contained in:
@@ -79,9 +79,9 @@ export default function SettingsView({
|
||||
let active = true;
|
||||
api.get<NotificationPrefs>("/notification-settings")
|
||||
.then(({ data }) => { if (active) setNotificationPrefs(data); })
|
||||
.catch((error) => { if (active) setNotificationError(getApiErrorMessage(error, "Notification settings could not be loaded.")); });
|
||||
.catch((error) => { if (active) setNotificationError(getApiErrorMessage(error, t("settingsNotificationsLoadFailed"))); });
|
||||
return () => { active = false; };
|
||||
}, []);
|
||||
}, [t]);
|
||||
|
||||
const saveNotifications = async () => {
|
||||
if (!notificationPrefs) return;
|
||||
@@ -90,9 +90,9 @@ export default function SettingsView({
|
||||
try {
|
||||
const { data } = await api.put<NotificationPrefs>("/notification-settings", notificationPrefs);
|
||||
setNotificationPrefs(data);
|
||||
toast("Notification settings saved.", "success");
|
||||
toast(t("settingsNotificationsSaved"), "success");
|
||||
} catch (error) {
|
||||
setNotificationError(getApiErrorMessage(error, "Notification settings could not be saved."));
|
||||
setNotificationError(getApiErrorMessage(error, t("settingsNotificationsSaveFailed")));
|
||||
} finally { setSavingNotifications(false); }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user