Kai Anforderung: TDR Chart keine Punkte auf 0 setzen, für bessere Darstellung

This commit is contained in:
ISA
2025-03-31 15:38:23 +02:00
parent d250dc1400
commit 458bce6c51
4 changed files with 23 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
"use client"; // /components/main/settingsPageComponents/GeneralSettings.tsx
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import { RootState } from "../../../redux/store";
import { useSelector } from "react-redux";
import handleClearDatabase from "./handlers/handleClearDatabase";
@@ -8,8 +8,12 @@ import handleSetDateTime from "./handlers/handleSetDateTime";
import handleSubmit from "./handlers/handleSubmit";
import { useAdminAuth } from "./hooks/useAdminAuth";
import handleAdminLogin from "./handlers/handleAdminLogin";
import { useDispatch } from "react-redux";
import { AppDispatch } from "../../../redux/store";
import { fetchSystemSettingsThunk } from "../../../redux/thunks/fetchSystemSettingsThunk";
const GeneralSettings = () => {
const GeneralSettings: React.FC = () => {
const dispatch = useDispatch<AppDispatch>();
const systemSettings = useSelector(
(state: RootState) => state.systemSettings
);
@@ -50,6 +54,14 @@ const GeneralSettings = () => {
}
);
};
//-------------------------------
useEffect(() => {
if (!systemSettings.deviceName) {
dispatch(fetchSystemSettingsThunk());
}
}, []);
//-------------------------------
return (
<div className="p-2 md:p-3 bg-gray-100 max-w-2xl mx-auto">
<h2 className="text-sm md:text-md font-bold mb-2">