mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-14 10:05:06 -05:00
- Update the canvas graph generation to flag its uploaded init and mask images as `intermediate`. - During canvas setup, hit the update route to associate the uploaded images with the session id. - Organize the socketio and RTK listener middlware better. Needed to facilitate the updated canvas logic. - Add a new action `sessionReadyToInvoke`. The `sessionInvoked` action is *only* ever run in response to this event. This lets us do whatever complicated setup (eg canvas) and explicitly invoking. Previously, invoking was tied to the socket subscribe events. - Some minor tidying.
63 lines
1.7 KiB
TypeScript
63 lines
1.7 KiB
TypeScript
// TODO: split system slice inot this
|
|
|
|
// import type { PayloadAction } from '@reduxjs/toolkit';
|
|
// import { createSlice } from '@reduxjs/toolkit';
|
|
// import { socketSubscribed, socketUnsubscribed } from 'services/events/actions';
|
|
|
|
// export type SessionState = {
|
|
// /**
|
|
// * The current socket session id
|
|
// */
|
|
// sessionId: string;
|
|
// /**
|
|
// * Whether the current session is a canvas session. Needed to manage the staging area.
|
|
// */
|
|
// isCanvasSession: boolean;
|
|
// /**
|
|
// * When a session is canceled, its ID is stored here until a new session is created.
|
|
// */
|
|
// canceledSessionId: string;
|
|
// };
|
|
|
|
// export const initialSessionState: SessionState = {
|
|
// sessionId: '',
|
|
// isCanvasSession: false,
|
|
// canceledSessionId: '',
|
|
// };
|
|
|
|
// export const sessionSlice = createSlice({
|
|
// name: 'session',
|
|
// initialState: initialSessionState,
|
|
// reducers: {
|
|
// sessionIdChanged: (state, action: PayloadAction<string>) => {
|
|
// state.sessionId = action.payload;
|
|
// },
|
|
// isCanvasSessionChanged: (state, action: PayloadAction<boolean>) => {
|
|
// state.isCanvasSession = action.payload;
|
|
// },
|
|
// },
|
|
// extraReducers: (builder) => {
|
|
// /**
|
|
// * Socket Subscribed
|
|
// */
|
|
// builder.addCase(socketSubscribed, (state, action) => {
|
|
// state.sessionId = action.payload.sessionId;
|
|
// state.canceledSessionId = '';
|
|
// });
|
|
|
|
// /**
|
|
// * Socket Unsubscribed
|
|
// */
|
|
// builder.addCase(socketUnsubscribed, (state) => {
|
|
// state.sessionId = '';
|
|
// });
|
|
// },
|
|
// });
|
|
|
|
// export const { sessionIdChanged, isCanvasSessionChanged } =
|
|
// sessionSlice.actions;
|
|
|
|
// export default sessionSlice.reducer;
|
|
|
|
export default {};
|