Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public class FileDetailActivitiesFragment extends Fragment implements

private int lastGiven;
private boolean isLoadingActivities;
private boolean isDataFetched = false;

private boolean restoreFileVersionSupported;
private FileOperationsHelper operationsHelper;
Expand Down Expand Up @@ -198,7 +199,7 @@ public void submitComment() {

String trimmedComment = commentField.toString().trim();

if (trimmedComment.length() > 0) {
if (trimmedComment.length() > 0 && ownCloudClient != null && isDataFetched) {
new SubmitCommentTask(trimmedComment, file.getLocalId(), callback, ownCloudClient).execute();
}
}
Expand Down Expand Up @@ -340,6 +341,8 @@ private void fetchAndSetData(int lastGiven) {
populateList(activitiesAndVersions, lastGiven == -1);
}
});

isDataFetched = true;
} else {
Log_OC.d(TAG, result.getLogMessage());
// show error
Expand All @@ -354,10 +357,13 @@ private void fetchAndSetData(int lastGiven) {
isLoadingActivities = false;
}
});

isDataFetched = false;
}

hideRefreshLayoutLoader(activity);
} catch (ClientFactory.CreationException e) {
isDataFetched = false;
Log_OC.e(TAG, "Error fetching file details activities", e);
}
});
Expand Down