Skip auxiliary data load when viewing revisions (#8460)

This commit is contained in:
Hemachandar
2025-02-17 19:15:06 +05:30
committed by GitHub
parent acc825b554
commit 5132c5814b

View File

@@ -183,7 +183,7 @@ function DataLoader({ match, children }: Props) {
// Prevents unauthorized request to load share information for the document
// when viewing a public share link
if (can.read && !document.isDeleted) {
if (can.read && !document.isDeleted && !revisionId) {
if (team.getPreference(TeamPreference.Commenting)) {
void comments.fetchAll({
documentId: document.id,
@@ -199,7 +199,17 @@ function DataLoader({ match, children }: Props) {
});
}
}
}, [can.read, can.update, document, isEditRoute, comments, team, shares, ui]);
}, [
can.read,
can.update,
document,
isEditRoute,
comments,
team,
shares,
ui,
revisionId,
]);
if (error) {
return error instanceof OfflineError ? (