Skip to content

Commit bf58fca

Browse files
Fixed upload from gallery
1 parent 23a195f commit bf58fca

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ public void uploadActionInitiated(String title, String description) {
169169
else //Send user to login activity
170170
{
171171
Toast.makeText(this, "You need to login first!", Toast.LENGTH_SHORT).show();
172-
applicationPrefs.edit().putBoolean("login_skipped", false).apply();
173172
Intent loginIntent = new Intent(ShareActivity.this, LoginActivity.class);
174173
startActivity(loginIntent);
175174
}
@@ -311,6 +310,12 @@ R.drawable.ic_error_outline_black_24dp, getTheme()))
311310
checkIfFileExists();
312311
gpsObj = fileObj.processFileCoordinates(locationPermitted);
313312
decimalCoords = fileObj.getDecimalCoords();
313+
if (sessionManager.getCurrentAccount() == null) {
314+
Toast.makeText(this, getString(R.string.login_alert_message), Toast.LENGTH_SHORT).show();
315+
applicationPrefs.edit().putBoolean("login_skipped", false).apply();
316+
Intent loginIntent = new Intent(ShareActivity.this, LoginActivity.class);
317+
startActivity(loginIntent);
318+
}
314319
}
315320

316321
/**

app/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
<string name="navigation_item_login">Log in</string>
251251
<string name="skip_login_title">Do you really want to skip login?</string>
252252
<string name="skip_login_message">You will not be able to upload pictures.</string>
253-
<string name="login_alert_message">This feature requires user to be logged in!</string>
253+
<string name="login_alert_message">Please log in to use this feature</string>
254254

255255
<string name="nearby_location_has_not_changed">Location has not changed.</string>
256256
<string name="nearby_location_not_available">Location not available.</string>

0 commit comments

Comments
 (0)