mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
Fix bug on deleting last cst
This commit is contained in:
parent
91c318f36a
commit
329c2f943e
|
@ -72,8 +72,6 @@ function EditorConstituenta({ activeID, onShowAST, onCreateCst, onRenameCst, onO
|
|||
setTextDefinition(activeCst.definition?.text?.raw ?? '');
|
||||
setExpression(activeCst.definition?.formal ?? '');
|
||||
setTypification(activeCst ? getCstTypificationLabel(activeCst) : 'N/A');
|
||||
} else if (schema && schema?.items.length > 0) {
|
||||
onOpenEdit(schema.items[0].id);
|
||||
}
|
||||
}, [activeCst, onOpenEdit, schema]);
|
||||
|
||||
|
|
|
@ -163,6 +163,12 @@ function RSTabs() {
|
|||
while (activeIndex < schema.items.length && deleted.find(id => id === schema.items[activeIndex].id)) {
|
||||
++activeIndex;
|
||||
}
|
||||
if (activeIndex >= schema.items.length) {
|
||||
activeIndex = schema.items.length - 1;
|
||||
while (activeIndex >= 0 && deleted.find(id => id === schema.items[activeIndex].id)) {
|
||||
--activeIndex;
|
||||
}
|
||||
}
|
||||
navigateTo(activeTab, schema.items[activeIndex].id);
|
||||
}
|
||||
if (afterDelete) afterDelete(deleted);
|
||||
|
|
Loading…
Reference in New Issue
Block a user