fix(ui): fix bug with staging bbox not resetting

This commit is contained in:
psychedelicious 2023-05-30 16:55:59 +10:00 committed by Kent Keirsey
parent cffcf80977
commit fab7a1d337

View File

@ -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 {