Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +2 -2
templates/index.html
CHANGED
|
@@ -1083,12 +1083,12 @@ async function exploreNode(nodeId, count, comment) {
|
|
| 1083 |
async function addOptionsToNode(nodeId, count) {
|
| 1084 |
showLoading('Adding new options...');
|
| 1085 |
try {
|
| 1086 |
-
|
| 1087 |
const data = await apiPost('/add_options', { node_id: nodeId, count });
|
| 1088 |
const newChildren = data.children || [];
|
| 1089 |
newChildren.forEach(child => addNodeToGraph(child, nodeId));
|
| 1090 |
const parentNode = nodes.find(n => n.id === nodeId);
|
| 1091 |
-
if (parentNode) parentNode._childrenCount
|
| 1092 |
renderCanvas();
|
| 1093 |
removeForeignPopup();
|
| 1094 |
selectedNodeId = null;
|
|
|
|
| 1083 |
async function addOptionsToNode(nodeId, count) {
|
| 1084 |
showLoading('Adding new options...');
|
| 1085 |
try {
|
| 1086 |
+
removeChildrenOf(nodeId);
|
| 1087 |
const data = await apiPost('/add_options', { node_id: nodeId, count });
|
| 1088 |
const newChildren = data.children || [];
|
| 1089 |
newChildren.forEach(child => addNodeToGraph(child, nodeId));
|
| 1090 |
const parentNode = nodes.find(n => n.id === nodeId);
|
| 1091 |
+
if (parentNode) parentNode._childrenCount + newChildren.length; // set, not add
|
| 1092 |
renderCanvas();
|
| 1093 |
removeForeignPopup();
|
| 1094 |
selectedNodeId = null;
|