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 { logger } from 'app/logging/logger';
import { isInitializedChanged } from 'features/system/store/systemSlice';
import { size } from 'lodash-es'; import { size } from 'lodash-es';
import { api } from 'services/api';
import { receivedOpenAPISchema } from 'services/api/thunks/schema'; import { receivedOpenAPISchema } from 'services/api/thunks/schema';
import { appSocketConnected, socketConnected } from 'services/events/actions'; import { appSocketConnected, socketConnected } from 'services/events/actions';
@ -15,7 +13,7 @@ export const addSocketConnectedEventListener = () => {
log.debug('Connected'); log.debug('Connected');
const { nodeTemplates, config, system } = getState(); const { nodeTemplates, config } = getState();
const { disabledTabs } = config; const { disabledTabs } = config;
@ -23,13 +21,6 @@ export const addSocketConnectedEventListener = () => {
dispatch(receivedOpenAPISchema()); 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 // pass along the socket event as an application action
dispatch(appSocketConnected(action.payload)); dispatch(appSocketConnected(action.payload));
}, },

View File

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

View File

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

View File

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