diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 9b915f6..5a9b1f1 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -256,15 +256,22 @@ const store = createStore({ // Daemon URL für lokale Entwicklung und Produktion let daemonUrl = import.meta.env.VITE_DAEMON_SOCKET; - // Für lokale Entwicklung: direkte Daemon-Verbindung - if (!daemonUrl && (import.meta.env.DEV || window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1')) { - daemonUrl = 'ws://localhost:4551'; + console.log('[Daemon] Umgebungsvariable VITE_DAEMON_SOCKET:', daemonUrl); + console.log('[Daemon] DEV-Modus:', import.meta.env.DEV); + console.log('[Daemon] Hostname:', window.location.hostname); + + // Nur wenn Umgebungsvariable NICHT gesetzt ist, Fallback-Logik verwenden + if (!daemonUrl) { + // Für lokale Entwicklung: direkte Daemon-Verbindung + if (import.meta.env.DEV || window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') { + daemonUrl = 'ws://localhost:4551'; + } else { + // Fallback für Produktion + daemonUrl = 'wss://www.your-part.de:4551'; + } } - // Fallback für Produktion - if (!daemonUrl) { - daemonUrl = 'wss://www.your-part.de:4551'; - } + console.log('[Daemon] Finale Daemon-URL:', daemonUrl); const connectDaemonSocket = () => { // Cleanup existing socket and timer