فهرست منبع

Merge pull request #24461 from overleaf/em-non-editable-file-in-history

Graceful fallback for getRangesSnapshot()

GitOrigin-RevId: 2f0e70dbcdd38de87d0b1c7590f7d8a5a7112937
Eric Mc Sween 1 سال پیش
والد
کامیت
20c7f14b3c
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      services/project-history/app/js/SnapshotManager.js

+ 5 - 1
services/project-history/app/js/SnapshotManager.js

@@ -73,7 +73,11 @@ async function getRangesSnapshot(projectId, version, pathname) {
     })
   }
   if (!file.isEditable()) {
-    throw new Error('File is not editable')
+    // A binary file has no tracked changes or comments
+    return {
+      changes: [],
+      comments: [],
+    }
   }
   const historyId = await WebApiManager.promises.getHistoryId(projectId)
   await file.load('eager', HistoryStoreManager.getBlobStore(historyId))