feature/IO-3499-React-19: Bug Fixes / Checkpoint
This commit is contained in:
@@ -77,14 +77,14 @@ const NotificationSettingsForm = ({ currentUser, bodyshop }) => {
|
||||
if (!result?.errors) {
|
||||
setAutoAddEnabled(checked);
|
||||
setInitialAutoAdd(checked);
|
||||
notification.success({ message: t("notifications.labels.auto-add-success") });
|
||||
notification.success({ title: t("notifications.labels.auto-add-success") });
|
||||
setIsDirty(false); // Reset dirty state if only auto-add was changed
|
||||
} else {
|
||||
throw new Error("Failed to update auto-add setting");
|
||||
}
|
||||
} catch {
|
||||
setAutoAddEnabled(!checked); // Revert on error
|
||||
notification.error({ message: t("notifications.labels.auto-add-failure") });
|
||||
notification.error({ title: t("notifications.labels.auto-add-failure") });
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -96,14 +96,14 @@ const NotificationSettingsForm = ({ currentUser, bodyshop }) => {
|
||||
try {
|
||||
const result = await updateNotificationSettings({ variables: { id: userId, ns: values } });
|
||||
if (!result?.errors) {
|
||||
notification.success({ message: t("notifications.labels.notification-settings-success") });
|
||||
notification.success({ title: t("notifications.labels.notification-settings-success") });
|
||||
setInitialValues(values);
|
||||
setIsDirty(false);
|
||||
} else {
|
||||
throw new Error("Failed to update notification settings");
|
||||
}
|
||||
} catch {
|
||||
notification.error({ message: t("notifications.labels.notification-settings-failure") });
|
||||
notification.error({ title: t("notifications.labels.notification-settings-failure") });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user