develop #24
@@ -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"}
|
||||
</button>
|
||||
{/* <ResetUserSettings /> */}
|
||||
<ResetUserSettings />
|
||||
</Form>
|
||||
)}
|
||||
</Formik>
|
||||
|
||||
@@ -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 <span className="font-bold">RESET ALL</span> user settings including{" "}
|
||||
<span className="text-blue-400">Uploaded user sounds</span> ,
|
||||
<span className="text-emerald-400"> Hotlist Sound hits</span> and{" "}
|
||||
<span className="text-amber-600">NPED Sound hits</span>. It will also reset any customized settings within
|
||||
<span className="text-amber-600">NPED Sound hits</span>.
|
||||
{/* It will also reset any customized settings within
|
||||
the app to their original defaults and Clear out the session data and{" "}
|
||||
<span className="text-rose-400">alert history sightings.</span>
|
||||
<span className="text-rose-400">alert history sightings.</span> */}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex justify-end gap-4">
|
||||
|
||||
Reference in New Issue
Block a user