mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): improve session creation handling
This commit is contained in:
@ -16,7 +16,11 @@ import {
|
||||
|
||||
import { ProgressImage } from 'services/events/types';
|
||||
import { makeToast } from '../../../app/components/Toaster';
|
||||
import { sessionCanceled, sessionInvoked } from 'services/thunks/session';
|
||||
import {
|
||||
sessionCanceled,
|
||||
sessionCreated,
|
||||
sessionInvoked,
|
||||
} from 'services/thunks/session';
|
||||
import { receivedModels } from 'services/thunks/model';
|
||||
import { parsedOpenAPISchema } from 'features/nodes/store/nodesSlice';
|
||||
import { LogLevelName } from 'roarr';
|
||||
@ -353,7 +357,7 @@ export const systemSlice = createSlice({
|
||||
});
|
||||
|
||||
/**
|
||||
* Session Canceled
|
||||
* Session Canceled - FULFILLED
|
||||
*/
|
||||
builder.addCase(sessionCanceled.fulfilled, (state, action) => {
|
||||
state.canceledSession = action.meta.arg.sessionId;
|
||||
@ -370,6 +374,23 @@ export const systemSlice = createSlice({
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Session Created - REJECTED
|
||||
*/
|
||||
builder.addCase(sessionCreated.rejected, (state, action) => {
|
||||
state.isProcessing = false;
|
||||
state.isCancelable = false;
|
||||
state.isCancelScheduled = false;
|
||||
state.currentStep = 0;
|
||||
state.totalSteps = 0;
|
||||
state.statusTranslationKey = 'common.statusConnected';
|
||||
state.progressImage = null;
|
||||
|
||||
state.toastQueue.push(
|
||||
makeToast({ title: t('toast.problemCreatingSession'), status: 'error' })
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Session Canceled
|
||||
*/
|
||||
|
Reference in New Issue
Block a user