Fix boards not starting with starting nodes

This commit is contained in:
thepaperpilot 2022-09-07 22:50:11 -05:00
parent 3dbacc8e21
commit 8f52918e38

View file

@ -211,7 +211,10 @@ export function createBoard<T extends BoardOptions>(
board[Component] = BoardComponent; board[Component] = BoardComponent;
board.state = persistent<BoardData>({ board.state = persistent<BoardData>({
nodes: [], nodes: board.startNodes().map((n, i) => {
(n as BoardNode).id = i;
return n as BoardNode;
}),
selectedNode: null, selectedNode: null,
selectedAction: null selectedAction: null
}); });