Преглед изворни кода

fix working with files stored in gundb

Nikolay Suslov пре 4 година
родитељ
комит
63887a9ef2

+ 120 - 103
public/app.js

@@ -279,13 +279,13 @@ class App {
 
           let created = new Date().valueOf();
 
-          let obj = {
-            //'owner': userPub,
-            'file': responseText,
-            'modified': created,
-            'created': created
-          }
-          proxyObj[entryName] = obj;
+          // let obj = {
+          //   //'owner': userPub,
+          //   'file': responseText,
+          //   'modified': created,
+          //   'created': created
+          // }
+          proxyObj[entryName] = responseText;
         }
       }
     }
@@ -335,12 +335,12 @@ class App {
           //let modified = new Date().valueOf();
           let created = new Date().valueOf();
 
-          let obj = {
-            'file': worldSource,
-            'modified': created,
-            'created': created
+          // let obj = {
+          //   'file': worldSource,
+          //   'modified': created,
+          //   'created': created
 
-          }
+          // }
 
           if (!worldsObj[worldName]) {
             worldsObj[worldName] = {
@@ -353,7 +353,7 @@ class App {
           }
 
           let entry = entryName.replace(worldName + '/', "");
-          worldsObj[worldName][entry] = obj;
+          worldsObj[worldName][entry] = worldSource
 
         }
       }
@@ -449,12 +449,12 @@ class App {
     Object.keys(emptyWorld).forEach(el => {
       //let modified = new Date().valueOf();
       let created = new Date().valueOf();
-      let obj = {
-        'file': emptyWorld[el],
-        'modified': created,
-        'created': created
-      }
-      worldsObj['empty'][el] = obj;
+      // let obj = {
+      //   'file': emptyWorld[el],
+      //   'modified': created,
+      //   'created': created
+      // }
+      worldsObj['empty'][el] = emptyWorld[el];
     })
 
     console.log(worldsObj);
@@ -736,12 +736,12 @@ class App {
                     //let modified = new Date().valueOf();
                     let created = new Date().valueOf();
           
-                    let obj = {
-                      'file': fileSource,
-                      'modified': created,
-                      'created': created
+                    // let obj = {
+                    //   'file': fileSource,
+                    //   'modified': created,
+                    //   'created': created
           
-                    }
+                    // }
 
                       world[worldName] = {
                         'parent': '-',
@@ -753,7 +753,7 @@ class App {
                     
           
                     let entry = entryName.replace(worldName + '/', "");
-                    world[worldName][entry] = obj;
+                    world[worldName][entry] = fileSource;
                     console.log(world);
 
                     worlds.put(world);
@@ -812,7 +812,7 @@ class App {
           onDrop: function (files, pos, fileList, directories) {
             console.log('onDrop: ' + files.length + ' files at ' + pos.x + ', ' + pos.y);
             //let worldsObj = {};
-            let proxy = _LCSDB.user().get('proxy');
+            let proxy = _LCSDB.user().get('proxy').put({id:'proxy'});
 
             files.forEach(function (file) {
 
@@ -839,13 +839,13 @@ class App {
           
                   let created = new Date().valueOf();
             
-                      let obj = {
-                        'owner': userPub,
-                        'file': fileSource,
-                        'modified': created,
-                        'created': created
-                      }
-                    proxyObj[entryName] = obj;
+                      // let obj = {
+                      //   'owner': userPub,
+                      //   'file': fileSource,
+                      //   'modified': created,
+                      //   'created': created
+                      // }
+                    proxyObj[entryName] = fileSource;
                     console.log(proxyObj);
                     proxy.put(proxyObj);
 
@@ -1084,7 +1084,7 @@ class App {
                       console.log("save new info");
                       let editor = document.querySelector("#aceEditor").env.editor;
                       let newInfo = editor.getValue();
-                      _LCSDB.user().get(worldType).get(worldName).get(file).get('file').put(newInfo, function (res) {
+                      _LCSDB.user().get(worldType).get(worldName).get(file).put(newInfo, function (res) {
                         if (res) {
 
                           let noty = new Noty({
@@ -1096,8 +1096,8 @@ class App {
                           });
                           noty.show();
 
-                          let modified = new Date().valueOf();
-                          _LCSDB.user().get(worldType).get(worldName).get(file).get('modified').put(modified);
+                          // let modified = new Date().valueOf();
+                          // _LCSDB.user().get(worldType).get(worldName).get(file).get('modified').put(modified);
                         }
                       })
                     }
@@ -1141,8 +1141,8 @@ class App {
                               });
                               noty.show();
 
-                              let modified = new Date().valueOf();
-                              _LCSDB.user().get(worldType).get(worldName).get(file).get('modified').put(modified);
+                              // let modified = new Date().valueOf();
+                              // _LCSDB.user().get(worldType).get(worldName).get(file).get('modified').put(modified);
                             }
                           })
                         }
@@ -1229,9 +1229,9 @@ class App {
     }
 
     if (type == 'protos') {
-      _app.indexApp.initWorldsProtosListForUser(user)//.getWorldsProtosListForUser(user); 
+      _app.indexApp.initWorldsProtosListForUserNew(user)//.getWorldsProtosListForUser(user); 
     } else if (type == 'states') {
-      _app.indexApp.initWorldsStatesListForUser(user);
+     // _app.indexApp.initWorldsStatesListForUser(user);
       //await _app.indexApp.getWorldsFromUserDB(user);
     }
 
@@ -1456,11 +1456,11 @@ class App {
     }).then(pr => {
 
       let cpath = pr.public_path;
-      return new Promise(res => _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').get(cpath.slice(1)).load(res, { wait: 400 }))
+      return new Promise(res => _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').get(cpath.slice(1)).load(res)) //, { wait: 400 }
 
     }).then(val => {
 
-      let res = val['index_vwf_config_yaml'].file;
+      let res = val['index_vwf_config_yaml'];
       var conf = "";
 
       if (res) {
@@ -1732,23 +1732,23 @@ class App {
   async getProtoWorldFiles(userPub, worldName, date) {
 
     let fileNamesAll = (await _LCSDB.user(userPub).get('worlds').get(worldName).promOnce()).data;
-    let worldFileNames = Object.keys(fileNamesAll).filter(el => (el !== '_') && (el !== 'owner') && (el !== 'parent') && (el !== 'featured') && (el !== 'published') && (el !== 'info_json') && (el !== '_config_yaml') && (el !== '_yaml') && (el !== '_html'));
+    let worldFileNames = Object.keys(fileNamesAll).filter(el => (el !== '_') && (el !== 'owner') && (el !== 'parent') && (el !== 'featured') && (el !== 'published') && (el !== 'info_json') && (el !== '_config_yaml') && (el !== '_yaml') && (el !== '_html') && (el !== 'proxy'));
 
     let worldObj = {};
     for (var doc in worldFileNames) {
       let fn = worldFileNames[doc];
       let res = (await _LCSDB.user(userPub).get('worlds').get(worldName).get(fn).promOnce()).data;
-      var data = {
-        'file': res.file,
-        'modified': res.modified,
-        'created': res.created
-      }
-      if (!date) {
-        data = {
-          'file': res.file
-        }
-      }
-      worldObj[fn] = data;
+      // var data = {
+      //   'file': res.file,
+      //   'modified': res.modified,
+      //   'created': res.created
+      // }
+      // if (!date) {
+      //   data = {
+      //     'file': res.file
+      //   }
+      // }
+      worldObj[fn] = res;
     }
     console.log(worldObj);
     return worldObj
@@ -1793,33 +1793,50 @@ class App {
     //let modified = new Date().valueOf();
     console.log('clone: ' + worldName + 'to: ' + worldID);
 
-
     let created = new Date().valueOf();
+    
 
     let worldObj = {
       'owner': newOwner,
       'parent': userName + '/' + worldName,
       'featured': true,
-      'published': true
+      'published': true,
+      'created': created
     };
 
     // let fileNamesAll = 
     await _LCSDB.user(userPub).get('worlds').get(worldName).load(all => {
 
+     
+
       let worldFileNames = Object.keys(all).filter(el => (el !== '_') && (el !== 'owner') && (el !== 'proxy') && (el !== 'parent') && (el !== 'featured') && (el !== 'published') && (el !== '_config_yaml') && (el !== '_yaml') && (el !== '_html'));
 
+      let myWorld = _LCSDB.user(newOwner).get('worlds').get(worldID).put({id:worldID});
+
       for (var doc in worldFileNames) {
 
         let fn = worldFileNames[doc];
         let res = all[fn]; //(await _LCSDB.user(userPub).get('worlds').get(worldName).get(fn).promOnce()).data;
-        let fileData = (typeof res.file == 'object') ? JSON.stringify(res.file) : res.file;
-        let data = {
-          'file': fileData, //JSON.stringify(res.file),
-          'modified': created
-        }
-        worldObj[fn] = data;
+        let fileData = (typeof res == 'object') ? JSON.stringify(res) : res;
+
+    
+        // let data = {
+        //   'file': fileData, //JSON.stringify(res.file),
+        //   'modified': created
+        // }
+        // //worldObj[fn] = data;
+
+        // myWorld.get([fn]).put({
+        //   'file': fileData, 
+        //   'modified': created
+        // })
+
+        myWorld.put({[fn]: fileData})
+        
       }
 
+
+
       if(!all.proxy){
         worldObj.proxy = userPub;
       } else {
@@ -1835,7 +1852,7 @@ class App {
       // }
 
       //let myWorlds = await _LCSDB.user(newOwner).get('worlds').once().then();
-      let myWorld = _LCSDB.user(newOwner).get('worlds').get(worldID).put({});
+      //let myWorld = _LCSDB.user(newOwner).get('worlds').get(worldID).put({id:worldID});
       myWorld.put(worldObj, function (res) {
         if (stateFileName) {
           self.saveStateAsFile(stateFileName)
@@ -2009,7 +2026,7 @@ class App {
     });
 
     // let docInfo  =  await _LCSDB.user().get('worlds').get(root).get('info_json').get('file').then();
-    _LCSDB.user().get('worlds').get(root).get('info_json').get('file').once(function (file) {
+    _LCSDB.user().get('worlds').get(root).get('info_json').once(function (file) {
 
       if (file) {
 
@@ -2044,43 +2061,43 @@ class App {
     });
 
 
-    // Save Config Information
-    var config = { "info": {}, "model": {}, "view": {} };
+    // // Save Config Information
+    // var config = { "info": {}, "model": {}, "view": {} };
 
-    // Save browser title
-    config["info"]["title"] = document.title//$('title').html();
+    // // Save browser title
+    // config["info"]["title"] = document.title//$('title').html();
 
-    // Save model drivers
-    Object.keys(vwf_view.kernel.kernel.models).forEach(function (modelDriver) {
-      if (modelDriver.indexOf('vwf/model/') != -1) config["model"][modelDriver] = "";
-    });
+    // // Save model drivers
+    // Object.keys(vwf_view.kernel.kernel.models).forEach(function (modelDriver) {
+    //   if (modelDriver.indexOf('vwf/model/') != -1) config["model"][modelDriver] = "";
+    // });
 
-    // If neither glge or threejs model drivers are defined, specify nodriver
-    if (config["model"]["vwf/model/glge"] === undefined && config["model"]["vwf/model/threejs"] === undefined) config["model"]["nodriver"] = "";
+    // // If neither glge or threejs model drivers are defined, specify nodriver
+    // if (config["model"]["vwf/model/glge"] === undefined && config["model"]["vwf/model/threejs"] === undefined) config["model"]["nodriver"] = "";
 
-    // Save view drivers and associated parameters, if any
-    Object.keys(vwf_view.kernel.kernel.views).forEach(function (viewDriver) {
-      if (viewDriver.indexOf('vwf/view/') != -1) {
-        if (vwf_view.kernel.kernel.views[viewDriver].parameters) {
-          config["view"][viewDriver] = vwf_view.kernel.kernel.views[viewDriver].parameters;
-        }
-        else config["view"][viewDriver] = "";
-      }
-    });
+    // // Save view drivers and associated parameters, if any
+    // Object.keys(vwf_view.kernel.kernel.views).forEach(function (viewDriver) {
+    //   if (viewDriver.indexOf('vwf/view/') != -1) {
+    //     if (vwf_view.kernel.kernel.views[viewDriver].parameters) {
+    //       config["view"][viewDriver] = vwf_view.kernel.kernel.views[viewDriver].parameters;
+    //     }
+    //     else config["view"][viewDriver] = "";
+    //   }
+    // });
 
-    //var jsonConfig = $.encoder.encodeForURL(JSON.stringify(config));
-    var jsonConfig = JSON.stringify(config);
+    // //var jsonConfig = $.encoder.encodeForURL(JSON.stringify(config));
+    // var jsonConfig = JSON.stringify(config);
 
 
 
-    let configStateForStore = {
-      "root": root,
-      "filename": filename,
-      "inst": inst,
-      "timestamp": timestamp,
-      "extension": "config.vwf.json",
-      "jsonState": jsonConfig
-    };
+    // let configStateForStore = {
+    //   "root": root,
+    //   "filename": filename,
+    //   "inst": inst,
+    //   "timestamp": timestamp,
+    //   "extension": "config.vwf.json",
+    //   "jsonState": jsonConfig
+    // };
 
     //let objName = loadInfo[ 'save_name' ] +'/'+ "savestate_" + loadInfo[ 'save_revision' ];
     // "savestate_" + loadInfo[ 'save_revision' ] + '/' + loadInfo[ 'save_name' ] + '_vwf_json'
@@ -2407,15 +2424,15 @@ class App {
 
         if (res && res !== 'null') {
 
-          if (res.file && res.file !== 'null') {
+          //if (res.file && res.file !== 'null') {
 
             let saveName = el.stateName.split('/')[2].replace('_info_vwf_json', "");
 
             var worldDesc = {};
-            if (typeof (res.file) == 'object') {
-              worldDesc = res.file
+            if (typeof (res) == 'object') {
+              worldDesc = res
             } else {
-              worldDesc = JSON.parse(res.file)
+              worldDesc = JSON.parse(res)
             }
 
 
@@ -2438,7 +2455,7 @@ class App {
               'info': appInfo,
               'settings': settings
             }
-          }
+          //}
         }
 
         if (Object.keys(doc).length !== 0) {
@@ -2509,15 +2526,15 @@ class App {
 
         if (res && res !== 'null') {
 
-          if (res.file && res.file !== 'null') {
+          //if (res.file && res.file !== 'null') {
 
             //let worldDesc = JSON.parse(res.file);
 
             var worldDesc = {};
-            if (typeof (res.file) == 'object') {
-              worldDesc = res.file
+            if (typeof (res) == 'object') {
+              worldDesc = res
             } else {
-              worldDesc = JSON.parse(res.file)
+              worldDesc = JSON.parse(res)
             }
 
             let root = Object.keys(worldDesc)[0];
@@ -2540,7 +2557,7 @@ class App {
               'info': appInfo,
               'settings': settings
             }
-          }
+          //}
         }
 
         if (Object.keys(doc).length !== 0)

+ 3 - 3
public/lib/index.css

@@ -434,12 +434,12 @@ text-shadow: 0px 0px 0 rgba(0, 0, 0, 0.3);
 
   position: absolute;
   border: 0;
-  right: 40px;
-  bottom: 20px;
+  right: 0px;
+  bottom: 70px;
   cursor: pointer;
   min-width: 50px;
   min-height: 30px;
-  padding-right: 5%;
+  padding-right: 2%;
   padding-top: 4%;
   position: absolute;
   transition: background-color .05s ease;

+ 4 - 4
public/vwf.js

@@ -4579,7 +4579,7 @@ if ( ! childComponent.source ) {
                 if(dbName.includes("vwf_example_com")){
                     //userDB = await window._LCS_SYS_USER.get('proxy').then();
                    fileName = dbName;
-                   let dbNode = proxyDB.get('proxy').get(fileName).get('file');
+                   let dbNode = proxyDB.get('proxy').get(fileName);
 
                    let nodeProm = new Promise(res => dbNode.once(res))
 
@@ -4597,7 +4597,7 @@ if ( ! childComponent.source ) {
                     let worldName = dbName.split('/')[0];
                     //userDB = await window._LCS_WORLD_USER.get('worlds').path(worldName).then();
                    fileName = dbName.replace(worldName + '/', "");
-                   let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName).get('file');
+                   let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);
 
                    let nodeProm = new Promise(res => dbNode.once(res))
                    nodeProm.then(comp=>{
@@ -4673,7 +4673,7 @@ if ( ! childComponent.source ) {
                 if(dbName.includes("vwf_example_com")){
                     //userDB = window._LCS_SYS_USER.get('proxy');
                     fileName = dbName;
-                    let dbNode = proxyDB.get('proxy').get(fileName).get('file');
+                    let dbNode = proxyDB.get('proxy').get(fileName);
                     let nodeProm = new Promise(res => dbNode.once(res))
 
                     nodeProm.then(comp=>{
@@ -4687,7 +4687,7 @@ if ( ! childComponent.source ) {
                 } else {
                     fileName = dbName.replace(worldName + '/', "");
 
-                    let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName).get('file');
+                    let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);
                     let nodeProm = new Promise(res => dbNode.once(res))
                     nodeProm.then(comp=>{
                         parseComp (comp);

+ 1 - 1
public/vwf/model/aframe.js

@@ -625,7 +625,7 @@ define(["module", "vwf/model", "vwf/utility"], function (module, model, utility)
                                 let dbPath = propertyValue.split(".").join("_");
 
                                 let userDB = _LCSDB.user(_LCS_WORLD_USER.pub);
-                                userDB.get('worlds').get(worldName).get(dbPath).get('file').once(function(response) {
+                                userDB.get('worlds').get(worldName).get(dbPath).once(function(response) {
                                     if (response) {
 
                                         if (Object.keys(response).length > 0) {

+ 3 - 3
public/vwf/view/document.js

@@ -85,11 +85,11 @@ define( [ "module", "vwf/view", "vwf/utility"], function( module, view, utility)
                 if(all){
                     if(Object.keys(all).includes(dbPath)){
 
-                        userDB.get('worlds').get(worldName).get(dbPath).get('file').load(function(res) { 
+                        userDB.get('worlds').get(worldName).get(dbPath).load(function(res) { 
                         //let res = all[dbPath].file;
                         loadDoc(res);
                         callback( true );
-                       },{wait:300})
+                       }) //,{wait:300}
                     } else {
                         //NEED TO FIXED!!! Error: Callback was already called.
                         // userDB.get('worlds').get('empty').get(dbPath).get('file').once(function(res) { 
@@ -106,7 +106,7 @@ define( [ "module", "vwf/view", "vwf/utility"], function( module, view, utility)
                     }
                 }
                 
-              },{wait:300})
+              }) //,{wait:300}
 
 
               

+ 1 - 1
public/vwf/view/editor-new.js

@@ -3183,7 +3183,7 @@ define([
                     let worldName = self.helpers.getRoot(true).root;//url.split('/')[0];
                     let userDB = _LCSDB.user(_LCS_WORLD_USER.pub);
 
-                    userDB.get('worlds').get(worldName).get(fileName).get('file').once(res => {
+                    userDB.get('worlds').get(worldName).get(fileName).once(res => {
 
                         this._importScript(res);
                     })

+ 135 - 2
public/web/index-app.js

@@ -92,7 +92,7 @@ class IndexApp {
         entry.setAttribute("id", 'app');
         document.body.appendChild(entry);
 
-        let divs = ['appGUI', 'userLobby', 'main', 'worldsGUI'];
+        let divs = ['appGUI', 'userLobby', 'main', 'worldsGUI', 'lab'];
         divs.forEach(el => {
             let appEl = document.createElement("div");
             appEl.setAttribute("id", el);
@@ -135,6 +135,8 @@ class IndexApp {
             }
         });
 
+       
+
     }
 
     async initWorldsProtosListForUser(userAlias) {
@@ -276,9 +278,140 @@ class IndexApp {
 
         if(this.entry == 'index'){
             //change for LiveCoding.space to 'app'
-            this.initWorldsProtosListForUser(alias);
+           this.initWorldsProtosListForUserNew(alias);
         }
+
+       
+
+
         
+    }
+
+    async initWorldsProtosListForUserNew (userAlias) {
+
+       let userPub = await _app.helpers.getUserPub(userAlias);
+       let db = _LCSDB.user(userPub);
+
+        document.querySelector("#lab").$cell({
+            id: "lab",
+            $cell: true,
+            $type: "div",
+            _createCard: function(data){
+
+                let card = {
+                    $type: "div",
+                    id: '#'+ data,
+                    _worldName: "",
+                    _worldInfo: "info",
+                    $init: function(){
+                        this._worldName = data;
+
+                        // _LCSDB.user().get('worlds')
+                        // .map((el,k)=>k === this._worldName? el : undefined) 
+                        // .get('info_json').once(
+                        //     res=>{
+                        //         console.log("New World: ", res);
+                        //         if(!res.file){
+                        //             _LCSDB.get(res['_']['#']).once(res=>{
+                        //                 console.log("New World force get: ", res);
+                        //             })
+                        //         }
+                        //     }
+                        // )
+
+
+                        db.get('worlds').get(this._worldName).once((res)=>{
+                            console.log(res);
+                            this._worldInfo = res['info_json'];
+                        })
+                    
+
+                  
+                        //     .map()
+                        // .on((res,k,n)=>{
+                        //     if(k == 'info_json'){
+                        //         console.log(res);
+                        //         this._worldInfo = res;
+                        //         //this.$update();
+                        //     }
+                        // })
+                    },
+                    $update: function(){
+                        
+                        this.$components = [
+                            {
+                                $type: "div",
+                                $text: this._worldName
+                            },
+                            {
+                                $type: "div",
+                                $text: this._worldInfo
+                            }
+                        ]
+                    }
+
+                }
+                return card
+            },
+            _comps: [],
+            $init: function () {
+                console.log('init lab...');
+
+                db.get('worlds')
+                .map()
+                .on((res,k)=>{
+                    console.log('From world: ', k);
+                    //let doc = document.querySelector('#'+ k);
+                   let doc = this._comps.filter(el=> el.id == '#'+ k)[0];
+
+                    if(!doc) {
+                        doc = this._createCard(k);
+                        this._comps.push(doc);
+                    } 
+
+                    // _LCSDB.get(res['info_json']).once((res)=>{
+                    //     console.log(res);
+                    //     doc._worldInfo = res.file
+                    // })
+                    //this._refresh();
+
+                })
+                // .map((k,r,n)=>{
+                //     if(r == 'info_json')
+                //         {
+                //         //console.log(r);
+                //         return k
+                //     }
+                // })
+                // .once((res,k,n)=>{
+                //     console.log(res);
+                //     if(doc)
+                //         doc._worldInfo = res.file
+                // })
+                // .map((k,r,n)=>{
+                //     if(r == 'file')
+                //         {
+                //         //console.log(r);
+                //         return k
+                //         }
+                //     })
+                //     .on((res,k,n)=>{
+                //         console.log('From info ', res);
+                //     })
+
+                // .map()
+                // .on((res,k)=>{
+                //     console.log(res);
+                // })
+            },
+            $update: function () {
+                //do update;
+                console.log('update me');
+                this.$components = this._comps;
+            }
+        });
+
+
     }
 
     initUser() {

+ 16 - 14
public/web/world-app.js

@@ -472,12 +472,14 @@ class WorldApp {
         var info = {};
 
 
-        if (!saveName) {
-            info = await _app.getAllProtoWorldsInfoForUser(user.user, space) //await _app.getWorldInfo(user, space);
-        } else {
-            let loadName = space + "/load/" + saveName;
-            info = await _app.getAllStateWorldsInfoForUser(user.user, space, loadName) //await _app.getStateInfo(user, space, saveName);
-        }
+        // if (!saveName) {
+        //     info = await _app.getAllProtoWorldsInfoForUser(user.user, space) //await _app.getWorldInfo(user, space);
+        // } else {
+        //     let loadName = space + "/load/" + saveName;
+        //     info = await _app.getAllStateWorldsInfoForUser(user.user, space, loadName) //await _app.getStateInfo(user, space, saveName);
+        // }
+
+        
         // worldCardGUI._worldInfo = info;
         // worldCardGUI.$update();
        
@@ -541,14 +543,14 @@ class WorldApp {
             }
         }
 
-        if (!saveName) {
-            let statesData = await _app.getAllStateWorldsInfoForUser(user.user, space) //await _app.getSaveStates(user, space);
-            //let worldStates = this.createWorldStatesGUI();
-            let worldStates = document.querySelector("#worldStatesGUI");
-            worldStates._states = statesData;
-            worldStates._updateComps();
-            worldStatesComp.$components.push(worldStates);
-        }
+        // if (!saveName) {
+        //     let statesData = await _app.getAllStateWorldsInfoForUser(user.user, space) //await _app.getSaveStates(user, space);
+        //     //let worldStates = this.createWorldStatesGUI();
+        //     let worldStates = document.querySelector("#worldStatesGUI");
+        //     worldStates._states = statesData;
+        //     worldStates._updateComps();
+        //     worldStatesComp.$components.push(worldStates);
+        // }
 
     }