Skip to content

Commit

Permalink
#122 #129 #137 - Does not re-instantiate a Deployment each time we ge…
Browse files Browse the repository at this point in the history
…t a new list from ExternalStorage or the server.
  • Loading branch information
hallahan committed Apr 19, 2016
1 parent a573824 commit 62d6212
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ private void putDeployment(JSONObject deploymentJson) {
nameToIdx.put(name, deployments.size());
deployments.add(deployment);
}

/**
* Note: Needs Server Synchronization
*
* https://github.com/AmericanRedCross/OpenMapKitAndroid/issues/137
*/
// replace existing deployment
else {
deployments.set(idx, deployment);
}
// else {
// deployments.set(idx, deployment);
// }
}

public void fetch(DeploymentsActivity activity, String url) {
Expand Down Expand Up @@ -110,8 +116,6 @@ private void parseJsonFromApi(String json) {
*/
private Deployments.Status fetchFromExternalStorage() {
Deployments.Status status = Status.SERVER_NOT_FOUND;
deployments.clear();
nameToIdx.clear();
List<File> files = ExternalStorage.allDeploymentJSONFiles();
for (File f : files) {
try {
Expand Down

0 comments on commit 62d6212

Please sign in to comment.