Update mood handling in FalukantService and enhance Socket.io configuration in store

- Modified mood assignment in FalukantService to conditionally wrap mood data in an object based on moodId presence, improving data structure consistency.
- Refactored Socket.io initialization in the store to dynamically set the secure option based on the URL scheme, enhancing connection security in production environments.
This commit is contained in:
Torsten Schulz (local)
2026-01-14 16:22:05 +01:00
parent 02d24eccd8
commit e852346b94
3 changed files with 64 additions and 4 deletions

View File

@@ -213,10 +213,17 @@ const store = createStore({
}
}
const socket = io(socketIoUrl, {
secure: true,
// Socket.io-Konfiguration: In Produktion mit HTTPS verwenden wir wss://
const socketOptions = {
transports: ['websocket', 'polling']
});
};
// Wenn HTTPS verwendet wird, muss secure: true gesetzt sein
if (socketIoUrl.startsWith('https://')) {
socketOptions.secure = true;
}
const socket = io(socketIoUrl, socketOptions);
socket.on('connect', () => {
state.backendRetryCount = 0; // Reset retry counter on successful connection