feat: handleSave Funktion ausgelagert und KueModal strukturiert
- handleSave in separate Datei handle-save.js ausgelagert, um KueModal-Komponente modularer und wartbarer zu gestalten - handleSaveWrapper in KueModal hinzugefügt, um Parameter an handleSave zu übergeben - KueModal umgestaltet, um Funktionen und Redux-Dispatch klarer zu organisieren - Konsistente Verwendung von Parametern und State-Updates für sauberen Codefluss
This commit is contained in:
19
components/modales/settingsModal/handlers/handleReboot.js
Normal file
19
components/modales/settingsModal/handlers/handleReboot.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// components/modales/handlers/handleReboot.js
|
||||
const handleReboot = () => {
|
||||
if (
|
||||
window.confirm("Sind Sie sicher, dass Sie den CPL neu starten möchten?")
|
||||
) {
|
||||
let currentPath = window.location.pathname;
|
||||
if (!currentPath.endsWith(".html")) {
|
||||
currentPath += ".html";
|
||||
}
|
||||
|
||||
const url = `${window.location.origin}/CPL?${currentPath}&BOOT=1`;
|
||||
console.log(url);
|
||||
fetch(url, { method: "GET" }).finally(() => {
|
||||
window.location.href = `/wait`;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default handleReboot;
|
||||
Reference in New Issue
Block a user