Commit 5af7d1af authored by Jacob Schatz's avatar Jacob Schatz

Fixes directory opening closing bug

parent 8a9375e9
......@@ -98,17 +98,26 @@ const RepoStore = {
removeChildFilesOfTree(tree) {
let foundTree = false;
const treetoClose = tree;
const treeToClose = tree;
let wereDone = false;
RepoStore.files = RepoStore.files.filter((file) => {
if (file.url === treetoClose.url) foundTree = true;
const isItTheTreeWeWant = file.url === treeToClose.url;
// if it's the next tree
if(foundTree && file.type === 'tree' && !isItTheTreeWeWant) {
wereDone = true;
return true;
}
if(wereDone) return true;
if (isItTheTreeWeWant) foundTree = true;
if (foundTree) return file.level <= treetoClose.level;
if (foundTree) return file.level <= treeToClose.level;
return true;
});
treetoClose.opened = false;
treetoClose.icon = 'fa-folder';
return treetoClose;
treeToClose.opened = false;
treeToClose.icon = 'fa-folder';
return treeToClose;
},
removeFromOpenedFiles(file) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment