Nikolay Suslov 6 years ago
parent
commit
3d5e372a1c
2 changed files with 17 additions and 6 deletions
  1. 13 2
      public/app.js
  2. 4 4
      public/web/world-app.js

+ 13 - 2
public/app.js

@@ -1871,7 +1871,7 @@ class App {
     return states
   }
 
-  async getStateInfo(user, space, saveName) {
+  async getStateInfo(user, space, saveName, gui) {
 
     let userPub = await _LCSDB.get('users').get(user).get('pub').once().then();
     var db = _LCSDB.user(userPub);
@@ -1913,11 +1913,17 @@ class App {
         }
     
     }
+    
+    if(gui){
+      gui._worldInfo = info;
+      gui.$update();
+    }
+
     return info
   }
 
 
-  async getWorldInfo(user, space) {
+  async getWorldInfo(user, space, gui) {
     //get space for user
 
     let userPub = await _LCSDB.get('users').get(user).get('pub').once().then();
@@ -1962,6 +1968,11 @@ class App {
       
     }
 
+    if(gui){
+      gui._worldInfo = info;
+      gui.$update();
+    }
+    
     return info
 
   }

+ 4 - 4
public/web/world-app.js

@@ -120,12 +120,12 @@ class WorldApp {
         var info = {};
 
         if (!saveName) {
-            info = await _app.getWorldInfo(user, space);
+            info = await _app.getWorldInfo(user, space, worldCardGUI);
         } else {
-            info = await _app.getStateInfo(user, space, saveName);
+            info = await _app.getStateInfo(user, space, saveName, worldCardGUI);
         }
-        worldCardGUI._worldInfo = info;
-        worldCardGUI.$update();
+        // worldCardGUI._worldInfo = info;
+        // worldCardGUI.$update();
 
         if (!saveName) {
             let statesData = await _app.getSaveStates(user, space);