Revert "Fix/connection toast timeout"

This commit is contained in:
Mose Müller
2023-11-03 09:11:40 +01:00
committed by GitHub
parent c5beee5d50
commit b32bdabfca
14 changed files with 42 additions and 261 deletions

View File

@ -109,6 +109,7 @@ const reducer = (state: State, action: Action): State => {
throw new Error();
}
};
const App = () => {
const [state, dispatch] = useReducer(reducer, null);
const stateRef = useRef(state); // Declare a reference to hold the current state
@ -149,11 +150,7 @@ const App = () => {
socket.on('disconnect', () => {
setConnectionStatus('disconnected');
setTimeout(() => {
// Only set "reconnecting" is the state is still "disconnected"
// E.g. when the client has already reconnected
setConnectionStatus((currentState) =>
currentState === 'disconnected' ? 'reconnecting' : currentState
);
setConnectionStatus('reconnecting');
}, 2000);
});

View File

@ -28,7 +28,9 @@ export const DataServiceComponent = React.memo(
if (name) {
fullAccessPath = parentPath.concat('.' + name);
}
console.log(fullAccessPath);
const id = getIdFromFullAccessPath(fullAccessPath);
console.log(id);
return (
<div className="dataServiceComponent" id={id}>