Skip to content

Commit e82fdd0

Browse files
authored
Fixes commons-app#2803 - Cancel nearby upload -> Next upload gets the same title/description
1 parent 6be9317 commit e82fdd0

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

app/src/main/java/fr/free/nrw/commons/nearby/contract/NearbyParentFragmentContract.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ interface UserActions {
8989
void detachView();
9090

9191
void setActionListeners(JsonKvStore applicationKvStore);
92+
void removeNearbyPreferences(JsonKvStore applicationKvStore);
9293
boolean backButtonClicked();
9394
void onCameraMove(com.mapbox.mapboxsdk.geometry.LatLng latLng);
9495
void filterByMarkerType(List<Label> selectedLabels, int state, boolean filterForPlaceState, boolean filterForAllNoneType);

app/src/main/java/fr/free/nrw/commons/nearby/fragments/NearbyParentFragment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ public void onLowMemory() {
435435
public void onDestroyView() {
436436
super.onDestroyView();
437437
mapView.onDestroy();
438+
presenter.removeNearbyPreferences(applicationKvStore);
438439
}
439440

440441
private void initViews() {

app/src/main/java/fr/free/nrw/commons/nearby/presenter/NearbyParentFragmentPresenter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import static fr.free.nrw.commons.nearby.CheckBoxTriStates.CHECKED;
3434
import static fr.free.nrw.commons.nearby.CheckBoxTriStates.UNCHECKED;
3535
import static fr.free.nrw.commons.nearby.CheckBoxTriStates.UNKNOWN;
36+
import static fr.free.nrw.commons.wikidata.WikidataConstants.PLACE_OBJECT;
3637

3738
public class NearbyParentFragmentPresenter
3839
implements NearbyParentFragmentContract.UserActions,
@@ -83,6 +84,12 @@ public void detachView(){
8384
this.nearbyParentFragmentView=DUMMY;
8485
}
8586

87+
@Override
88+
public void removeNearbyPreferences(JsonKvStore applicationKvStore) {
89+
Timber.d("Remove place objects");
90+
applicationKvStore.remove(PLACE_OBJECT);
91+
}
92+
8693
public void initializeMapOperations() {
8794
lockUnlockNearby(false);
8895
updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED);

0 commit comments

Comments
 (0)