mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
dont reload UI when socket reconnects
This commit is contained in:
parent
8e17e29a5c
commit
1d265dac5e
@ -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));
|
||||
},
|
||||
|
@ -1,7 +1,6 @@
|
||||
import type { SystemState } from './types';
|
||||
|
||||
export const systemPersistDenylist: (keyof SystemState)[] = [
|
||||
'isInitialized',
|
||||
'isConnected',
|
||||
'denoiseProgress',
|
||||
'status',
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user