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

Editor: Wait for storage before initialising agent.

Mr.doob пре 1 година
родитељ
комит
b4b3e0c860
2 измењених фајлова са 7 додато и 1 уклоњено
  1. 2 0
      editor/index.html
  2. 5 1
      editor/js/Agent.js

+ 2 - 0
editor/index.html

@@ -129,6 +129,8 @@
 
 					}
 
+					editor.signals.storageLoaded.dispatch();
+
 				} );
 
 				//

+ 5 - 1
editor/js/Agent.js

@@ -27,7 +27,11 @@ class Agent {
 		this.generateRandomColor = this.generateRandomColor.bind( this );
 		this.generateUniqueObjectName = this.generateUniqueObjectName.bind( this );
 
-		this.init();
+		this.editor.signals.storageLoaded.add( () => {
+
+			this.init();
+
+		} );
 
 	}
 

粤ICP备19079148号