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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user