Update folder finder.

This commit is contained in:
Kasen IO 2020-05-21 19:52:43 -04:00
parent 259203dd9b
commit 49cdfd7711
2 changed files with 4 additions and 16 deletions

View file

@ -1143,9 +1143,9 @@ export default {
return null; return null;
}, },
recursiveFolderPopulate: function(indexToSearch, firstIteration, avoidFolder) { recursiveFolderPopulate: function(indexToSearch, avoidFolder) {
for (var i = 0; i < indexToSearch.length; i++) { for (var i = 0; i < indexToSearch.length; i++) {
if (Object.prototype.hasOwnProperty.call(indexToSearch[i], "items") && indexToSearch[i].items.length > 0) { if (Object.prototype.hasOwnProperty.call(indexToSearch[i], "items")) {
// We want to avoid adding the folder itself and also any child folders it may have, putting a folder within its child folder will nuke it. // We want to avoid adding the folder itself and also any child folders it may have, putting a folder within its child folder will nuke it.
if (avoidFolder !== indexToSearch[i].uuid) { if (avoidFolder !== indexToSearch[i].uuid) {
this.recursiveFolderHoldingList.push({ this.recursiveFolderHoldingList.push({
@ -1153,14 +1153,12 @@ export default {
"uuid": indexToSearch[i].uuid, "uuid": indexToSearch[i].uuid,
}); });
this.recursiveFolderPopulate(indexToSearch[i].items, false, avoidFolder); this.recursiveFolderPopulate(indexToSearch[i].items, avoidFolder);
} }
} }
} }
if (firstIteration === true) {
return this.recursiveFolderHoldingList; return this.recursiveFolderHoldingList;
}
}, },
sendInventory: function() { sendInventory: function() {
this.sendAppMessage("web-to-script-inventory", this.itemsStore ); this.sendAppMessage("web-to-script-inventory", this.itemsStore );

View file

@ -18,7 +18,6 @@ export const store = new Vuex.Store({
state: { state: {
items: [ items: [
{ {
"hasChildren": false,
"type": "script", "type": "script",
"name": "VRGrabScale", "name": "VRGrabScale",
"url": "https://gooawefaweawfgle.com/vr.js", "url": "https://gooawefaweawfgle.com/vr.js",
@ -110,7 +109,6 @@ export const store = new Vuex.Store({
// "uuid": "54354363wgsegs45ujs", // "uuid": "54354363wgsegs45ujs",
// }, // },
{ {
"hasChildren": false,
"type": "script", "type": "script",
"name": "VRGrabScale", "name": "VRGrabScale",
"url": "https://googfdafsgaergale.com/vr.js", "url": "https://googfdafsgaergale.com/vr.js",
@ -118,7 +116,6 @@ export const store = new Vuex.Store({
"uuid": "54hgfhgf254354353", "uuid": "54hgfhgf254354353",
}, },
{ {
"hasChildren": false,
"type": "script", "type": "script",
"name": "TEST", "name": "TEST",
"url": "https://gooadfdagle.com/vr.js", "url": "https://gooadfdagle.com/vr.js",
@ -126,7 +123,6 @@ export const store = new Vuex.Store({
"uuid": "542rfwat4t5fsddf4354353", "uuid": "542rfwat4t5fsddf4354353",
}, },
{ {
"hasChildren": false,
"type": "json", "type": "json",
"name": "TESTJSON", "name": "TESTJSON",
"url": "https://gooadfdagle.com/vr.json", "url": "https://gooadfdagle.com/vr.json",
@ -134,7 +130,6 @@ export const store = new Vuex.Store({
"uuid": "542rfwat4t54354353", "uuid": "542rfwat4t54354353",
}, },
{ {
"hasChildren": false,
"type": "script", "type": "script",
"name": "TESTLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG", "name": "TESTLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG",
"url": "https://googfdaffle.com/vrLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG.js", "url": "https://googfdaffle.com/vrLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG.js",
@ -142,7 +137,6 @@ export const store = new Vuex.Store({
"uuid": "5425ggsrg45354353", "uuid": "5425ggsrg45354353",
}, },
{ {
"hasChildren": false,
"type": "whatttype", "type": "whatttype",
"name": "BrokenIcon", "name": "BrokenIcon",
"url": "https://googfdaffle.com/vrLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG.js", "url": "https://googfdaffle.com/vrLONGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG.js",
@ -150,7 +144,6 @@ export const store = new Vuex.Store({
"uuid": "5425ggsrg4fdaffdff535asdasd4353", "uuid": "5425ggsrg4fdaffdff535asdasd4353",
}, },
{ {
"hasChildren": false,
"type": "avatar", "type": "avatar",
"name": "AVI", "name": "AVI",
"url": "https://googlfadfe.com/vr.fst", "url": "https://googlfadfe.com/vr.fst",
@ -158,7 +151,6 @@ export const store = new Vuex.Store({
"uuid": "542gregg45s3g4354353", "uuid": "542gregg45s3g4354353",
}, },
{ {
"hasChildren": false,
"type": "avatar", "type": "avatar",
"name": "AVI", "name": "AVI",
"url": "https://googlefdaf.com/vr.fst", "url": "https://googlefdaf.com/vr.fst",
@ -166,7 +158,6 @@ export const store = new Vuex.Store({
"uuid": "5420798-087-54354353", "uuid": "5420798-087-54354353",
}, },
{ {
"hasChildren": false,
"type": "model", "type": "model",
"name": "3D MODEL", "name": "3D MODEL",
"url": "https://googlee.com/vr.fbx", "url": "https://googlee.com/vr.fbx",
@ -174,7 +165,6 @@ export const store = new Vuex.Store({
"uuid": "54254354980-7667jt353", "uuid": "54254354980-7667jt353",
}, },
{ {
"hasChildren": false,
"type": "place", "type": "place",
"name": "PLACE DOMAIN", "name": "PLACE DOMAIN",
"url": "https://googleee.com/vr.fbx", "url": "https://googleee.com/vr.fbx",