From fab7a1d337aa5cc42b54d636dabc0c25970702cd Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 30 May 2023 16:55:59 +1000 Subject: [PATCH] fix(ui): fix bug with staging bbox not resetting --- .../frontend/web/src/features/canvas/store/canvasSlice.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts index ad0581e42f..7f41066ba1 100644 --- a/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts +++ b/invokeai/frontend/web/src/features/canvas/store/canvasSlice.ts @@ -29,6 +29,7 @@ import { isCanvasMaskLine, } from './canvasTypes'; import { ImageDTO } from 'services/api'; +import { sessionCanceled } from 'services/thunks/session'; export const initialLayerState: CanvasLayerState = { objects: [], @@ -844,6 +845,13 @@ export const canvasSlice = createSlice({ state.isTransformingBoundingBox = false; }, }, + extraReducers: (builder) => { + builder.addCase(sessionCanceled.pending, (state) => { + if (!state.layerState.stagingArea.images.length) { + state.layerState.stagingArea = initialLayerState.stagingArea; + } + }); + }, }); export const {