dont reload UI when socket reconnects

This commit is contained in:
Mary Hipp 2024-01-05 12:47:48 -05:00
parent 8e17e29a5c
commit 1d265dac5e
4 changed files with 2 additions and 18 deletions

View File

@ -1,7 +1,5 @@
import { logger } from 'app/logging/logger';
import { isInitializedChanged } from 'features/system/store/systemSlice';
import { size } from 'lodash-es';
import { api } from 'services/api';
import { receivedOpenAPISchema } from 'services/api/thunks/schema';
import { appSocketConnected, socketConnected } from 'services/events/actions';
@ -15,7 +13,7 @@ export const addSocketConnectedEventListener = () => {
log.debug('Connected');
const { nodeTemplates, config, system } = getState();
const { nodeTemplates, config } = getState();
const { disabledTabs } = config;
@ -23,13 +21,6 @@ export const addSocketConnectedEventListener = () => {
dispatch(receivedOpenAPISchema());
}
if (system.isInitialized) {
// only reset the query caches if this connect event is a *reconnect* event
dispatch(api.util.resetApiState());
} else {
dispatch(isInitializedChanged(true));
}
// pass along the socket event as an application action
dispatch(appSocketConnected(action.payload));
},

View File

@ -1,7 +1,6 @@
import type { SystemState } from './types';
export const systemPersistDenylist: (keyof SystemState)[] = [
'isInitialized',
'isConnected',
'denoiseProgress',
'status',

View File

@ -25,7 +25,6 @@ import {
import type { Language, SystemState } from './types';
export const initialSystemState: SystemState = {
isInitialized: false,
isConnected: false,
shouldConfirmOnDelete: true,
enableImageDebugging: false,
@ -83,10 +82,7 @@ export const systemSlice = createSlice({
action: PayloadAction<boolean>
) {
state.shouldEnableInformationalPopovers = action.payload;
},
isInitializedChanged(state, action: PayloadAction<boolean>) {
state.isInitialized = action.payload;
},
}
},
extraReducers(builder) {
/**
@ -205,7 +201,6 @@ export const {
shouldUseNSFWCheckerChanged,
shouldUseWatermarkerChanged,
setShouldEnableInformationalPopovers,
isInitializedChanged,
} = systemSlice.actions;
export default systemSlice.reducer;

View File

@ -43,7 +43,6 @@ export const isLanguage = (v: unknown): v is Language =>
zLanguage.safeParse(v).success;
export interface SystemState {
isInitialized: boolean;
isConnected: boolean;
shouldConfirmOnDelete: boolean;
enableImageDebugging: boolean;