feat(ui): improve session creation handling

This commit is contained in:
psychedelicious
2023-05-26 15:53:08 +10:00
parent 1d4d705795
commit 8f190169db
6 changed files with 99 additions and 54 deletions

View File

@ -8,11 +8,7 @@ import {
import { socketSubscribed, socketUnsubscribed } from './actions';
import { AppThunkDispatch, RootState } from 'app/store/store';
import { getTimestamp } from 'common/util/getTimestamp';
import {
sessionInvoked,
sessionCreated,
sessionWithoutGraphCreated,
} from 'services/thunks/session';
import { sessionCreated } from 'services/thunks/session';
import { OpenAPI } from 'services/api';
import { setEventListeners } from 'services/events/util/setEventListeners';
import { log } from 'app/logging/useLogger';
@ -66,10 +62,7 @@ export const socketMiddleware = () => {
socket.connect();
}
if (
sessionCreated.fulfilled.match(action) ||
sessionWithoutGraphCreated.fulfilled.match(action)
) {
if (sessionCreated.fulfilled.match(action)) {
const sessionId = action.payload.id;
const oldSessionId = getState().system.sessionId;