fix occurrences of 'root' branch

This commit is contained in:
zadam
2022-12-28 13:09:49 +01:00
parent ff1f01be8c
commit f809da58ec
7 changed files with 9 additions and 8 deletions

View File

@@ -143,7 +143,7 @@ function setExpanded(req) {
const {branchId} = req.params;
const expanded = parseInt(req.params.expanded);
if (branchId !== 'root') {
if (branchId !== 'none_root') {
sql.execute("UPDATE branches SET isExpanded = ? WHERE branchId = ?", [expanded, branchId]);
// we don't sync expanded label
// also this does not trigger updates to the frontend, this would trigger too many reloads
@@ -172,7 +172,7 @@ function setExpandedForSubtree(req) {
SELECT branchId FROM tree`, [branchId]);
// root is always expanded
branchIds = branchIds.filter(branchId => branchId !== 'root');
branchIds = branchIds.filter(branchId => branchId !== 'none_root');
sql.executeMany(`UPDATE branches SET isExpanded = ${expanded} WHERE branchId IN (???)`, branchIds);