feat(tdr): Alert nach TDR-Aktivierung/Deaktivierung + automatischer Seitenreload für sichtbare Statusänderung
This commit is contained in:
@@ -120,6 +120,14 @@ export default function TdrEinstellung({ slot, onClose }: Props) {
|
||||
const isDev = window.location.hostname === "localhost";
|
||||
const slotParam = `KTX${slot}=${newState ? 1 : 0}`;
|
||||
|
||||
const reloadAfterConfirm = () => {
|
||||
const msg = newState
|
||||
? "✅ TDR wurde aktiviert."
|
||||
: "⚠️ TDR wurde deaktiviert.";
|
||||
alert(msg);
|
||||
location.reload();
|
||||
};
|
||||
|
||||
if (isDev) {
|
||||
const updates = [{ key: "win_tdrActive", slot, value: newState ? 1 : 0 }];
|
||||
|
||||
@@ -131,6 +139,7 @@ export default function TdrEinstellung({ slot, onClose }: Props) {
|
||||
.then((res) => res.json())
|
||||
.then(() => {
|
||||
console.log("TDR-Aktiv-Status gespeichert.");
|
||||
reloadAfterConfirm();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("Fehler beim Speichern von TDR aktiv:", err);
|
||||
@@ -141,6 +150,7 @@ export default function TdrEinstellung({ slot, onClose }: Props) {
|
||||
.then((res) => {
|
||||
if (!res.ok) throw new Error("TDR-Befehl fehlgeschlagen");
|
||||
console.log("TDR aktiviert/deaktiviert:", res.status);
|
||||
reloadAfterConfirm();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("Fehler beim TDR-Befehl:", err);
|
||||
|
||||
Reference in New Issue
Block a user