mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): update client for removal of session events
This commit is contained in:
parent
3d8774d295
commit
60784a4361
@ -45,7 +45,6 @@ import { addInvocationStartedEventListener } from 'app/store/middleware/listener
|
||||
import { addModelInstallEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketModelInstall';
|
||||
import { addModelLoadEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketModelLoad';
|
||||
import { addSocketQueueItemStatusChangedEventListener } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketQueueItemStatusChanged';
|
||||
import { addSessionEventListeners } from 'app/store/middleware/listenerMiddleware/listeners/socketio/socketSessionEvents';
|
||||
import { addStagingAreaImageSavedListener } from 'app/store/middleware/listenerMiddleware/listeners/stagingAreaImageSaved';
|
||||
import { addUpdateAllNodesRequestedListener } from 'app/store/middleware/listenerMiddleware/listeners/updateAllNodesRequested';
|
||||
import { addUpscaleRequestedListener } from 'app/store/middleware/listenerMiddleware/listeners/upscaleRequested';
|
||||
@ -99,7 +98,6 @@ addCommitStagingAreaImageListener(startAppListening);
|
||||
|
||||
// Socket.IO
|
||||
addGeneratorProgressEventListener(startAppListening);
|
||||
addSessionEventListeners(startAppListening);
|
||||
addInvocationCompleteEventListener(startAppListening);
|
||||
addInvocationErrorEventListener(startAppListening);
|
||||
addInvocationStartedEventListener(startAppListening);
|
||||
|
@ -1,26 +0,0 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import type { AppStartListening } from 'app/store/middleware/listenerMiddleware';
|
||||
import { socketSessionCanceled, socketSessionComplete, socketSessionStarted } from 'services/events/actions';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addSessionEventListeners = (startAppListening: AppStartListening) => {
|
||||
startAppListening({
|
||||
actionCreator: socketSessionStarted,
|
||||
effect: (action) => {
|
||||
log.debug(action.payload, 'Session started');
|
||||
},
|
||||
});
|
||||
startAppListening({
|
||||
actionCreator: socketSessionComplete,
|
||||
effect: (action) => {
|
||||
log.debug(action.payload, 'Session complete');
|
||||
},
|
||||
});
|
||||
startAppListening({
|
||||
actionCreator: socketSessionCanceled,
|
||||
effect: (action) => {
|
||||
log.debug(action.payload, 'Session canceled');
|
||||
},
|
||||
});
|
||||
};
|
@ -11,7 +11,6 @@ import {
|
||||
socketModelLoadComplete,
|
||||
socketModelLoadStarted,
|
||||
socketQueueItemStatusChanged,
|
||||
socketSessionComplete,
|
||||
} from 'services/events/actions';
|
||||
|
||||
import type { Language, SystemState } from './types';
|
||||
@ -125,14 +124,6 @@ export const systemSlice = createSlice({
|
||||
state.status = 'CONNECTED';
|
||||
});
|
||||
|
||||
/**
|
||||
* Graph Execution State Complete
|
||||
*/
|
||||
builder.addCase(socketSessionComplete, (state) => {
|
||||
state.denoiseProgress = null;
|
||||
state.status = 'CONNECTED';
|
||||
});
|
||||
|
||||
builder.addCase(socketModelLoadStarted, (state) => {
|
||||
state.status = 'LOADING_MODEL';
|
||||
});
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { Flex, IconButton, Text } from '@invoke-ai/ui-library';
|
||||
import { t } from 'i18next';
|
||||
import { upperFirst } from 'lodash-es';
|
||||
import { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { PiCopyBold } from 'react-icons/pi';
|
||||
@ -32,7 +31,7 @@ export default function ErrorToastDescription({ errorType, errorMessage, session
|
||||
return t(descriptionTKey);
|
||||
}
|
||||
if (errorMessage) {
|
||||
return upperFirst(errorMessage);
|
||||
return `${errorType}: ${errorMessage}`;
|
||||
}
|
||||
}, [errorMessage, errorType, isLocal, t]);
|
||||
return (
|
||||
|
@ -21,9 +21,6 @@ import type {
|
||||
ModelLoadCompleteEvent,
|
||||
ModelLoadStartedEvent,
|
||||
QueueItemStatusChangedEvent,
|
||||
SessionCanceledEvent,
|
||||
SessionCompleteEvent,
|
||||
SessionStartedEvent,
|
||||
} from 'services/events/types';
|
||||
|
||||
// Create actions for each socket
|
||||
@ -45,18 +42,6 @@ export const socketInvocationError = createAction<{
|
||||
data: InvocationErrorEvent;
|
||||
}>('socket/socketInvocationError');
|
||||
|
||||
export const socketSessionStarted = createAction<{
|
||||
data: SessionStartedEvent;
|
||||
}>('socket/socketSessionStarted');
|
||||
|
||||
export const socketSessionComplete = createAction<{
|
||||
data: SessionCompleteEvent;
|
||||
}>('socket/socketGraphExecutionStateComplete');
|
||||
|
||||
export const socketSessionCanceled = createAction<{
|
||||
data: SessionCanceledEvent;
|
||||
}>('socket/socketSessionCanceled');
|
||||
|
||||
export const socketGeneratorProgress = createAction<{
|
||||
data: InvocationDenoiseProgressEvent;
|
||||
}>('socket/socketGeneratorProgress');
|
||||
|
@ -26,10 +26,6 @@ export type DownloadCompleteEvent = S['DownloadCompleteEvent'];
|
||||
export type DownloadCancelledEvent = S['DownloadCancelledEvent'];
|
||||
export type DownloadErrorEvent = S['DownloadErrorEvent'];
|
||||
|
||||
export type SessionStartedEvent = S['SessionStartedEvent'];
|
||||
export type SessionCompleteEvent = S['SessionCompleteEvent'];
|
||||
export type SessionCanceledEvent = S['SessionCanceledEvent'];
|
||||
|
||||
export type QueueItemStatusChangedEvent = S['QueueItemStatusChangedEvent'];
|
||||
|
||||
export type BulkDownloadStartedEvent = S['BulkDownloadStartedEvent'];
|
||||
@ -50,9 +46,6 @@ export type ServerToClientEvents = {
|
||||
invocation_complete: (payload: InvocationCompleteEvent) => void;
|
||||
invocation_error: (payload: InvocationErrorEvent) => void;
|
||||
invocation_started: (payload: InvocationStartedEvent) => void;
|
||||
session_started: (payload: SessionStartedEvent) => void;
|
||||
session_complete: (payload: SessionCompleteEvent) => void;
|
||||
session_canceled: (payload: SessionCanceledEvent) => void;
|
||||
download_started: (payload: DownloadStartedEvent) => void;
|
||||
download_progress: (payload: DownloadProgressEvent) => void;
|
||||
download_complete: (payload: DownloadCompleteEvent) => void;
|
||||
|
@ -27,9 +27,6 @@ import {
|
||||
socketModelLoadComplete,
|
||||
socketModelLoadStarted,
|
||||
socketQueueItemStatusChanged,
|
||||
socketSessionCanceled,
|
||||
socketSessionComplete,
|
||||
socketSessionStarted,
|
||||
} from 'services/events/actions';
|
||||
import type { ClientToServerEvents, ServerToClientEvents } from 'services/events/types';
|
||||
import type { Socket } from 'socket.io-client';
|
||||
@ -88,18 +85,6 @@ export const setEventListeners = (arg: SetEventListenersArg) => {
|
||||
dispatch(socketInvocationComplete({ data }));
|
||||
});
|
||||
|
||||
socket.on('session_started', (data) => {
|
||||
dispatch(socketSessionStarted({ data }));
|
||||
});
|
||||
|
||||
socket.on('session_complete', (data) => {
|
||||
dispatch(socketSessionComplete({ data }));
|
||||
});
|
||||
|
||||
socket.on('session_canceled', (data) => {
|
||||
dispatch(socketSessionCanceled({ data }));
|
||||
});
|
||||
|
||||
socket.on('model_load_started', (data) => {
|
||||
dispatch(socketModelLoadStarted({ data }));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user