Merge pull request #10674 from osmandapp/fix_upload_of_edits

Fix upload of OSM Edits | Fix #10658
This commit is contained in:
Vitaliy 2021-01-27 11:42:27 +02:00 committed by GitHub
commit 2e6ec0928f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -12,6 +12,7 @@
--> -->
<string name="toast_select_edits_for_upload">Select edits for upload</string>
<string name="copy_to_map_favorites">Copy to favorites</string> <string name="copy_to_map_favorites">Copy to favorites</string>
<string name="copy_to_map_markers">Copy to map markers</string> <string name="copy_to_map_markers">Copy to map markers</string>
<string name="delete_waypoints">Delete waypoints</string> <string name="delete_waypoints">Delete waypoints</string>

View file

@ -295,8 +295,12 @@ public class OsmEditsFragment extends OsmAndListFragment implements ProgressDial
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
uploadItems(osmEditsSelected.toArray(new OsmPoint[0])); if (Algorithms.isEmpty(osmEditsSelected)) {
mode.finish(); app.showToastMessage(R.string.toast_select_edits_for_upload);
} else {
uploadItems(osmEditsSelected.toArray(new OsmPoint[0]));
mode.finish();
}
return true; return true;
} }
}); });