Refactor AddContainerToSelectedContainer
This commit is contained in:
parent
d05d0fb196
commit
b1b30e8486
4 changed files with 19 additions and 28 deletions
|
@ -140,16 +140,17 @@ export function Editor(props: IEditorProps): JSX.Element {
|
|||
historyCurrentStep
|
||||
))}
|
||||
addContainer={(type) => {
|
||||
const newHistory = AddContainerToSelectedContainer(
|
||||
if (selected === null || selected === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
setNewHistory(AddContainerToSelectedContainer(
|
||||
type,
|
||||
selected,
|
||||
configuration,
|
||||
history,
|
||||
historyCurrentStep
|
||||
);
|
||||
if (newHistory !== null) {
|
||||
setNewHistory(newHistory);
|
||||
}
|
||||
));
|
||||
}}
|
||||
addContainerAt={(index, type, parent) => setNewHistory(
|
||||
AddContainer(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue