mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): when a session errors, reset controlnet processing spinner
This commit is contained in:
parent
8b6c0be259
commit
de0fd87035
@ -1,4 +1,4 @@
|
|||||||
import { PayloadAction } from '@reduxjs/toolkit';
|
import { PayloadAction, isAnyOf } from '@reduxjs/toolkit';
|
||||||
import { createSlice } from '@reduxjs/toolkit';
|
import { createSlice } from '@reduxjs/toolkit';
|
||||||
import { RootState } from 'app/store/store';
|
import { RootState } from 'app/store/store';
|
||||||
import { ImageDTO } from 'services/api';
|
import { ImageDTO } from 'services/api';
|
||||||
@ -16,6 +16,8 @@ import {
|
|||||||
import { controlNetImageProcessed } from './actions';
|
import { controlNetImageProcessed } from './actions';
|
||||||
import { imageDeleted, imageUrlsReceived } from 'services/thunks/image';
|
import { imageDeleted, imageUrlsReceived } from 'services/thunks/image';
|
||||||
import { forEach } from 'lodash-es';
|
import { forEach } from 'lodash-es';
|
||||||
|
import { isAnySessionRejected } from 'services/thunks/session';
|
||||||
|
import { appSocketInvocationError } from 'services/events/actions';
|
||||||
|
|
||||||
export const initialControlNet: Omit<ControlNetConfig, 'controlNetId'> = {
|
export const initialControlNet: Omit<ControlNetConfig, 'controlNetId'> = {
|
||||||
isEnabled: true,
|
isEnabled: true,
|
||||||
@ -242,6 +244,14 @@ export const controlNetSlice = createSlice({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
builder.addCase(appSocketInvocationError, (state, action) => {
|
||||||
|
state.pendingControlImages = [];
|
||||||
|
});
|
||||||
|
|
||||||
|
builder.addMatcher(isAnySessionRejected, (state, action) => {
|
||||||
|
state.pendingControlImages = [];
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
import { UseToastOptions } from '@chakra-ui/react';
|
import { UseToastOptions } from '@chakra-ui/react';
|
||||||
import { PayloadAction, isAnyOf } from '@reduxjs/toolkit';
|
import { PayloadAction } from '@reduxjs/toolkit';
|
||||||
import { createSlice } from '@reduxjs/toolkit';
|
import { createSlice } from '@reduxjs/toolkit';
|
||||||
import * as InvokeAI from 'app/types/invokeai';
|
import * as InvokeAI from 'app/types/invokeai';
|
||||||
|
|
||||||
import { ProgressImage } from 'services/events/types';
|
import { ProgressImage } from 'services/events/types';
|
||||||
import { makeToast } from '../../../app/components/Toaster';
|
import { makeToast } from '../../../app/components/Toaster';
|
||||||
import {
|
import { isAnySessionRejected, sessionCanceled } from 'services/thunks/session';
|
||||||
sessionCanceled,
|
|
||||||
sessionCreated,
|
|
||||||
sessionInvoked,
|
|
||||||
} from 'services/thunks/session';
|
|
||||||
import { receivedModels } from 'services/thunks/model';
|
import { receivedModels } from 'services/thunks/model';
|
||||||
import { parsedOpenAPISchema } from 'features/nodes/store/nodesSlice';
|
import { parsedOpenAPISchema } from 'features/nodes/store/nodesSlice';
|
||||||
import { LogLevelName } from 'roarr';
|
import { LogLevelName } from 'roarr';
|
||||||
@ -462,8 +458,3 @@ export const {
|
|||||||
} = systemSlice.actions;
|
} = systemSlice.actions;
|
||||||
|
|
||||||
export default systemSlice.reducer;
|
export default systemSlice.reducer;
|
||||||
|
|
||||||
const isAnySessionRejected = isAnyOf(
|
|
||||||
sessionCreated.rejected,
|
|
||||||
sessionInvoked.rejected
|
|
||||||
);
|
|
||||||
|
@ -2,6 +2,7 @@ import { createAppAsyncThunk } from 'app/store/storeUtils';
|
|||||||
import { GraphExecutionState, SessionsService } from 'services/api';
|
import { GraphExecutionState, SessionsService } from 'services/api';
|
||||||
import { log } from 'app/logging/useLogger';
|
import { log } from 'app/logging/useLogger';
|
||||||
import { isObject } from 'lodash-es';
|
import { isObject } from 'lodash-es';
|
||||||
|
import { isAnyOf } from '@reduxjs/toolkit';
|
||||||
|
|
||||||
const sessionLog = log.child({ namespace: 'session' });
|
const sessionLog = log.child({ namespace: 'session' });
|
||||||
|
|
||||||
@ -115,3 +116,8 @@ export const listedSessions = createAppAsyncThunk(
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const isAnySessionRejected = isAnyOf(
|
||||||
|
sessionCreated.rejected,
|
||||||
|
sessionInvoked.rejected
|
||||||
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user