fix(ui): do not delete all layers when using image as initial image

This commit is contained in:
psychedelicious 2024-05-03 09:27:21 +10:00 committed by Kent Keirsey
parent 5734a97c55
commit c05e52ebae

View File

@ -627,7 +627,7 @@ export const controlLayersSlice = createSlice({
reducer: (state, action: PayloadAction<{ layerId: string; imageDTO: ImageDTO | null }>) => {
const { layerId, imageDTO } = action.payload;
// Highlander! There can be only one!
state.layers = state.layers.filter((l) => isInitialImageLayer(l));
state.layers = state.layers.filter((l) => (isInitialImageLayer(l) ? false : true));
const layer: InitialImageLayer = {
id: layerId,
type: 'initial_image_layer',