Updated loading states and error states accross app

This commit is contained in:
2025-10-06 14:21:56 +01:00
parent ad0ffa6df6
commit f275f50383
25 changed files with 377 additions and 101 deletions

View File

@@ -4,7 +4,6 @@ import type { ModemSettingsType } from "../../../types/types";
import { useWifiAndModem } from "../../../hooks/useCameraWifiandModem";
import { useEffect, useState } from "react";
import ModemToggle from "./ModemToggle";
import { toast } from "sonner";
const ModemSettings = () => {
const [showSettings, setShowSettings] = useState(false);
@@ -50,11 +49,6 @@ const ModemSettings = () => {
],
};
modemMutation.mutate(modemConfig);
if (modemMutation.error) {
toast.error("Failed to update modem settings");
return;
}
toast.success("Modem settings updated");
};
return (

View File

@@ -2,7 +2,6 @@ import { Field, Form, Formik } from "formik";
import FormGroup from "../components/FormGroup";
import type { WifiSettingValues } from "../../../types/types";
import { useWifiAndModem } from "../../../hooks/useCameraWifiandModem";
import { toast } from "sonner";
import { useState } from "react";
import { faEyeSlash, faEye } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -36,12 +35,6 @@ const WiFiSettingsForm = () => {
};
wifiMutation.mutate(wifiConfig);
if (wifiMutation.error) {
toast.error("Failed to update WiFi settings");
return;
}
toast.success("WiFi settings updated");
};
return (
<Formik