Fixes #2803 - Cancel nearby upload -> Next upload gets the same title/description

This commit is contained in:
Pratham Pahariya 2021-02-23 19:12:41 +05:30 committed by GitHub
parent 6be9317eac
commit e82fdd0f4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View file

@ -89,6 +89,7 @@ public interface NearbyParentFragmentContract {
void detachView();
void setActionListeners(JsonKvStore applicationKvStore);
void removeNearbyPreferences(JsonKvStore applicationKvStore);
boolean backButtonClicked();
void onCameraMove(com.mapbox.mapboxsdk.geometry.LatLng latLng);
void filterByMarkerType(List<Label> selectedLabels, int state, boolean filterForPlaceState, boolean filterForAllNoneType);

View file

@ -435,6 +435,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
public void onDestroyView() {
super.onDestroyView();
mapView.onDestroy();
presenter.removeNearbyPreferences(applicationKvStore);
}
private void initViews() {

View file

@ -33,6 +33,7 @@ import static fr.free.nrw.commons.location.LocationServiceManager.LocationChange
import static fr.free.nrw.commons.nearby.CheckBoxTriStates.CHECKED;
import static fr.free.nrw.commons.nearby.CheckBoxTriStates.UNCHECKED;
import static fr.free.nrw.commons.nearby.CheckBoxTriStates.UNKNOWN;
import static fr.free.nrw.commons.wikidata.WikidataConstants.PLACE_OBJECT;
public class NearbyParentFragmentPresenter
implements NearbyParentFragmentContract.UserActions,
@ -83,6 +84,12 @@ public class NearbyParentFragmentPresenter
this.nearbyParentFragmentView=DUMMY;
}
@Override
public void removeNearbyPreferences(JsonKvStore applicationKvStore) {
Timber.d("Remove place objects");
applicationKvStore.remove(PLACE_OBJECT);
}
public void initializeMapOperations() {
lockUnlockNearby(false);
updateMapAndList(LOCATION_SIGNIFICANTLY_CHANGED);