From bec28b91e152abc070fe93a65790d6ec254a8fdb Mon Sep 17 00:00:00 2001
From: Toba Ojo
Date: Wed, 7 Jan 2026 09:52:01 +0000
Subject: [PATCH] add ResetUserSettings component and integrate it into
SystemConfigFields
---
.../SettingForms/System/SystemConfigFields.tsx | 4 ++--
.../ResetUserSettingsModal.tsx | 18 ++++++++++++++----
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/components/SettingForms/System/SystemConfigFields.tsx b/src/components/SettingForms/System/SystemConfigFields.tsx
index 76bf378..22755e0 100644
--- a/src/components/SettingForms/System/SystemConfigFields.tsx
+++ b/src/components/SettingForms/System/SystemConfigFields.tsx
@@ -8,7 +8,7 @@ import { useDNSSettings, useSystemConfig } from "../../../hooks/useSystemConfig"
import { ValidateIPaddress, isUtcOutOfSync } from "../../../utils/utils";
import { toast } from "sonner";
import { useSystemStatus } from "../../../hooks/useSystemStatus";
-// import ResetUserSettings from "./resetUserSettings/ResetUserSettings";
+import ResetUserSettings from "./resetUserSettings/ResetUserSettings";
const SystemConfigFields = () => {
const { saveSystemSettings, systemSettingsData, saveSystemSettingsLoading } = useSystemConfig();
@@ -218,7 +218,7 @@ const SystemConfigFields = () => {
>
{hardRebootMutation.isPending || isSubmitting ? "Rebooting" : "Hardware Reboot"}
- {/* */}
+
)}
diff --git a/src/components/SettingForms/System/resetUserSettings/ResetUserSettingsModal.tsx b/src/components/SettingForms/System/resetUserSettings/ResetUserSettingsModal.tsx
index 79280ea..eba907b 100644
--- a/src/components/SettingForms/System/resetUserSettings/ResetUserSettingsModal.tsx
+++ b/src/components/SettingForms/System/resetUserSettings/ResetUserSettingsModal.tsx
@@ -1,4 +1,5 @@
import { useSoundContext } from "../../../../context/SoundContext";
+import { useCameraBlackboard } from "../../../../hooks/useCameraBlackboard";
import ModalComponent from "../../../UI/ModalComponent";
type ResetUserSettingsModalProps = {
@@ -10,14 +11,22 @@ const ResetUserSettingsModal = ({
isUserSettingsModalOpen,
setIsUserSettingsModalOpen,
}: ResetUserSettingsModalProps) => {
- const { dispatch } = useSoundContext();
+ const { state, dispatch } = useSoundContext();
+ const { mutation } = useCameraBlackboard();
const handleClose = () => {
setIsUserSettingsModalOpen(false);
};
- const handleResetAll = () => {
+ const handleResetAll = async () => {
// Logic to reset all user settings goes here
dispatch({ type: "RESET" });
+
+ await mutation.mutateAsync({
+ operation: "INSERT",
+ path: "soundSettings",
+ value: state,
+ });
+
handleClose();
};
return (
@@ -31,9 +40,10 @@ const ResetUserSettingsModal = ({
This will RESET ALL user settings including{" "}
Uploaded user sounds ,
Hotlist Sound hits and{" "}
- NPED Sound hits. It will also reset any customized settings within
+ NPED Sound hits.
+ {/* It will also reset any customized settings within
the app to their original defaults and Clear out the session data and{" "}
- alert history sightings.
+ alert history sightings. */}