mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Compare commits
4 Commits
separate-g
...
maryhipp/d
Author | SHA1 | Date | |
---|---|---|---|
bff484e791 | |||
30bfee8fda | |||
dc9ab9af99 | |||
1d265dac5e |
@ -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));
|
||||||
},
|
},
|
||||||
|
@ -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',
|
||||||
|
@ -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,
|
||||||
@ -84,9 +83,6 @@ export const systemSlice = createSlice({
|
|||||||
) {
|
) {
|
||||||
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;
|
||||||
|
@ -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;
|
||||||
|
@ -28,10 +28,18 @@ export const socketConnected = createAction('socket/socketConnected');
|
|||||||
export const appSocketConnected = createAction('socket/appSocketConnected');
|
export const appSocketConnected = createAction('socket/appSocketConnected');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Socket.IO Disconnect
|
* Socket.IO Connection Error
|
||||||
*
|
*
|
||||||
* Do not use. Only for use in middleware.
|
* Do not use. Only for use in middleware.
|
||||||
*/
|
*/
|
||||||
|
export const socketConnectionError = createAction<{ error: Error }>(
|
||||||
|
'socket/socketConnectionError'
|
||||||
|
); /**
|
||||||
|
|
||||||
|
* Socket.IO Disconnect
|
||||||
|
*
|
||||||
|
* Do not use. Only for use in middleware.
|
||||||
|
*/
|
||||||
export const socketDisconnected = createAction('socket/socketDisconnected');
|
export const socketDisconnected = createAction('socket/socketDisconnected');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,6 +4,7 @@ import { addToast } from 'features/system/store/systemSlice';
|
|||||||
import { makeToast } from 'features/system/util/makeToast';
|
import { makeToast } from 'features/system/util/makeToast';
|
||||||
import {
|
import {
|
||||||
socketConnected,
|
socketConnected,
|
||||||
|
socketConnectionError,
|
||||||
socketDisconnected,
|
socketDisconnected,
|
||||||
socketGeneratorProgress,
|
socketGeneratorProgress,
|
||||||
socketGraphExecutionStateComplete,
|
socketGraphExecutionStateComplete,
|
||||||
@ -56,6 +57,7 @@ export const setEventListeners = (arg: SetEventListenersArg) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
dispatch(socketConnectionError({ error }));
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user