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

Fixes directory opening closing bug

parent 8a9375e9
...@@ -98,17 +98,26 @@ const RepoStore = { ...@@ -98,17 +98,26 @@ const RepoStore = {
removeChildFilesOfTree(tree) { removeChildFilesOfTree(tree) {
let foundTree = false; let foundTree = false;
const treetoClose = tree; const treeToClose = tree;
let wereDone = false;
RepoStore.files = RepoStore.files.filter((file) => { 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; return true;
}); });
treetoClose.opened = false; treeToClose.opened = false;
treetoClose.icon = 'fa-folder'; treeToClose.icon = 'fa-folder';
return treetoClose; return treeToClose;
}, },
removeFromOpenedFiles(file) { 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