History: Fix regression with delete
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Eric NGUYEN 2022-08-16 16:34:44 +02:00
parent 1622816035
commit 0fcc2244bb

View file

@ -7,7 +7,6 @@ import { getCurrentHistory } from './Editor';
import IProperties from '../../Interfaces/IProperties';
import { AddMethod } from '../../Enums/AddMethod';
import { IAvailableContainer } from '../../Interfaces/IAvailableContainer';
import { transformX } from '../SVG/Elements/Container';
import { XPositionReference } from '../../Enums/XPositionReference';
/**
@ -58,7 +57,7 @@ export function DeleteContainer(
setHistoryCurrentStep: Dispatch<SetStateAction<number>>
): void {
const history = getCurrentHistory(fullHistory, historyCurrentStep);
const current = history[historyCurrentStep];
const current = history[history.length - 1];
const mainContainerClone: IContainerModel = structuredClone(current.MainContainer);
const container = findContainerById(mainContainerClone, containerId);