Unverified Commit fbe026a4 authored by Justus's avatar Justus Committed by Jeffrey I. Schiller

Fix loading of Projects with multiple Extensions

Change-Id: I142c4808c2bca82983cfa669b8864b49ce1ec670
parent d37f1050
......@@ -23,6 +23,7 @@ import com.google.appinventor.client.explorer.project.ProjectChangeListener;
import com.google.appinventor.client.output.OdeLog;
import com.google.appinventor.client.properties.json.ClientJsonParser;
import com.google.appinventor.common.utils.StringUtils;
import com.google.appinventor.shared.properties.json.JSONObject;
import com.google.appinventor.shared.rpc.project.ChecksumedFileException;
import com.google.appinventor.shared.rpc.project.ChecksumedLoadFile;
import com.google.appinventor.shared.rpc.project.ProjectNode;
......@@ -474,11 +475,11 @@ public final class YaProjectEditor extends ProjectEditor implements ProjectChang
this.onFailure(e);
return;
}
JSONObject componentJSONObject = new ClientJsonParser().parse(jsonFileContent).asObject();
COMPONENT_DATABASE.addComponentDatabaseListener(projectEditor);
COMPONENT_DATABASE.addComponent(new ClientJsonParser().parse(
jsonFileContent).asObject());
if (!externalComponents.contains(compNode.getName())) { // In case of upgrade, we do not need to add entry
externalComponents.add(compNode.getName());
COMPONENT_DATABASE.addComponent(componentJSONObject);
if (!externalComponents.contains(componentJSONObject.get("name").toString())) { // In case of upgrade, we do not need to add entry
externalComponents.add(componentJSONObject.get("name").toString());
}
if (afterComponentAdded != null) {
afterComponentAdded.execute();
......
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