Skip to content

Commit

Permalink
show info toast only when needed
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Mayer <[email protected]>
  • Loading branch information
JonasMayerDev committed Dec 21, 2023
1 parent 1877f3e commit a2303f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,22 @@ private void loadItems() {
private void refresh() {
backgroundJobManager.startImmediateFilesSyncJob(false, true);

// retry failed uploads
new Thread(() -> FileUploader.retryFailedUploads(
this,
uploadsStorageManager,
connectivityService,
userAccountManager,
powerManagementService))
.start();
if(uploadsStorageManager.getFailedUploads().length > 0){
// retry failed uploads
new Thread(() -> FileUploader.retryFailedUploads(
this,
uploadsStorageManager,
connectivityService,
userAccountManager,
powerManagementService))
.start();
DisplayUtils.showSnackMessage(this, R.string.uploader_local_files_uploaded);
}


// update UI
uploadListAdapter.loadUploadItemsFromDb();
swipeListRefreshLayout.setRefreshing(false);
DisplayUtils.showSnackMessage(this, R.string.uploader_local_files_uploaded);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@
<string name="failed_to_start_editor">Failed to start editor</string>
<string name="create_rich_workspace">Add folder info</string>
<string name="creates_rich_workspace">creates folder info</string>
<string name="uploader_local_files_uploaded">Try to upload local files again</string>
<string name="uploader_local_files_uploaded">Retry to upload failed local files</string>
<string name="uploader_file_not_found_on_server_message">We couldnt locate the file on server. Another user may have deleted the file</string>
<string name="uploader_file_not_found_message">File not found. Are you sure that this file exists or has a previous conflict not been resolved?</string>
<string name="uploader_upload_failed_sync_conflict_error">File upload conflict</string>
Expand Down

0 comments on commit a2303f5

Please sign in to comment.