Debug-Logging zentralisiert: Nutzung von process.env.NEXT_PUBLIC_DEBUG_LOG entfernt und auf getDebugLog() mit config.json umgestellt
- Alle Vorkommen von process.env.NEXT_PUBLIC_DEBUG_LOG entfernt - Debug-Konfiguration erfolgt jetzt ausschließlich über public/config.json - getDebugLog()-Utility überall verwendet - .env-Dateien werden für Debug-Logging nicht mehr benötigt - Alle betroffenen Komponenten, Services und API
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
// utils/setupDevices.js
|
||||
|
||||
import { setSelectedDevice, clearSelectedDevice } from "../redux/slices/selectedDeviceSlice";
|
||||
import { getDebugLog } from "./configUtils";
|
||||
|
||||
export const setupDevices = async (map, deviceMarkers, dispatch) => {
|
||||
for (const marker of deviceMarkers) {
|
||||
marker.on("mouseover", function () {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("✅ Gerät ausgewählt:", marker);
|
||||
}
|
||||
dispatch(setSelectedDevice(marker.options)); // Gerät in Redux speichern
|
||||
});
|
||||
|
||||
marker.on("mouseout", function () {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("❌ Gerät abgewählt");
|
||||
}
|
||||
dispatch(clearSelectedDevice()); // Gerät aus Redux entfernen
|
||||
|
||||
Reference in New Issue
Block a user