Skip to content

Commit 47dc1af

Browse files
simarsingh24iamareebjamal
authored andcommitted
fix: Move IS_DOWNLOAD_DONE logic inside methods (fossasia#2212)
1 parent 4ebfd46 commit 47dc1af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

android/app/src/main/java/org/fossasia/openevent/activities/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ protected void onCreate(Bundle savedInstanceState) {
191191
if (Utils.isBaseUrlEmpty()) {
192192
if (!SharedPreferencesUtil.getBoolean(ConstantStrings.IS_DOWNLOAD_DONE, false)) {
193193
downloadFromAssets();
194-
SharedPreferencesUtil.putBoolean(ConstantStrings.IS_DOWNLOAD_DONE, true);
195194
}
196195
} else {
197196
downloadData();
@@ -464,6 +463,7 @@ private void downloadFailed(final DownloadEvent event) {
464463
else
465464
OpenEventApp.postEventOnUIThread(event);
466465
}).show();
466+
SharedPreferencesUtil.putBoolean(ConstantStrings.IS_DOWNLOAD_DONE, false);
467467

468468
}
469469

@@ -836,6 +836,7 @@ public void downloadFromAssets() {
836836
} else {
837837
completeHandler.hide();
838838
}
839+
SharedPreferencesUtil.putBoolean(ConstantStrings.IS_DOWNLOAD_DONE, true);
839840
}
840841

841842
public void readJsonAsset(final String name) {

0 commit comments

Comments
 (0)