Skip to content

Commit

Permalink
For #100 - devices-geofences map was updated incorrectly after geo-fe…
Browse files Browse the repository at this point in the history
…nce saving
  • Loading branch information
vitalidze committed Apr 3, 2015
1 parent 521c68d commit 332fe1c
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ public void onSuccess(GeoFence geoFence) {
}
geoFenceStore.update(geoFence);
geoFenceStore.applySort(false);
for (Collection<GeoFence> geoFences : deviceGeoFences.values()) {
geoFences.remove(geoFence);
}
geoFenceAdded(geoFence);
geoFenceManagementStopped();
}

Expand Down Expand Up @@ -212,10 +216,12 @@ public void onSelected(GeoFence geoFence) {
if (selectedGeoFence != null && !selectedGeoFence.isAllDevices()) {
mapController.removeGeoFence(selectedGeoFence);
}
if (!geoFence.isAllDevices()) {
mapController.drawGeoFence(geoFence, true);
if (geoFence != null) {
if (!geoFence.isAllDevices()) {
mapController.drawGeoFence(geoFence, true);
}
mapController.selectGeoFence(geoFence);
}
mapController.selectGeoFence(geoFence);
selectedGeoFence = geoFence;
}

Expand Down

0 comments on commit 332fe1c

Please sign in to comment.