fixed annoying bug where the trigger disappears when you edit

This commit is contained in:
ari committed 2022-01-14 11:38:08 -05:00
1 parent 9d13785985
commit 7296a2c518
4 files changed
+3 -6

No files matched your search

@@ -75,7 +75,7 @@ export const AutomationEditor: FC<Props> = ({
dims={dims}
sequence={automation.sequence}
onChange={updateSequence}
additionalElements={chain([
additionalElements={() => chain([
computeExtraField([1, 0.5], [2, 0.5]),
computeTriggerPos(
[0.5, 0.5],
@@ -27,12 +27,9 @@ export const AutomationList: FC<AutomationListParams> = ({
children,
}) => {
// state
// const [searchParams, setSearchParams] = useSearchParams();
const [hideList, setHideList] = useState(false);
const [current, setCurrent] = useState(0);
// alias
// const current = Number(searchParams.get("current") ?? "0");
// const setCurrent = (i: number) => setSearchParams({ current: String(i) });
const currentAuto = automations.length > 0 ? automations[current] : null;
const automationListListCls = "automation-list--list" + (hideList ? " hide" : " show")
// render
@@ -60,7 +60,7 @@ export const SequenceNodes: FC<SequenceNodeProps & { zoomLevel: number }> = (pro
s => setModalState(s)
);
if (props.additionalElements) {
elmIter = chain([elmIter, props.additionalElements]);
elmIter = chain([elmIter, props.additionalElements()]);
}
// render
+1 -1
View File
@@ -11,7 +11,7 @@ export interface SequenceNodeProps {
dims: DAGBoardElmDims;
sequence: AutomationSequenceNode[],
onChange: (s: AutomationSequenceNode[]) => void;
additionalElements?: Generator<DAGElement>;
additionalElements?: () => Generator<DAGElement>;
}
export type ModalState = {