Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix revisions load

sytolk110ddb8d72c5
diff --git a/app/components/Revisions.tsx b/app/components/Revisions.tsx
index 02e355bd9..dc7f8a0b5 100644
--- a/app/components/Revisions.tsx
+++ b/app/components/Revisions.tsx
@@ -71,23 +71,25 @@ function Revisions() {
}, [openedEntries]);
function loadHistoryItems(openedFile: OpenedEntry) {
- Pro.MetaOperations.getMetadataID(openedFile.path, openedFile.uuid).then(
- id => {
- openedFile.uuid = id;
- const backupFilePath = getBackupFileLocation(
- openedFile.path,
- openedFile.uuid,
- PlatformIO.getDirSeparator()
- );
- const backupPath = extractContainingDirectoryPath(
- backupFilePath,
- PlatformIO.getDirSeparator()
- );
- PlatformIO.listDirectoryPromise(backupPath, []).then(h =>
- setRows(h.sort((a, b) => (a.lmdt < b.lmdt ? 1 : -1)))
- );
- }
- );
+ if (Pro) {
+ Pro.MetaOperations.getMetadataID(openedFile.path, openedFile.uuid).then(
+ id => {
+ openedFile.uuid = id;
+ const backupFilePath = getBackupFileLocation(
+ openedFile.path,
+ openedFile.uuid,
+ PlatformIO.getDirSeparator()
+ );
+ const backupPath = extractContainingDirectoryPath(
+ backupFilePath,
+ PlatformIO.getDirSeparator()
+ );
+ PlatformIO.listDirectoryPromise(backupPath, []).then(h =>
+ setRows(h.sort((a, b) => (a.lmdt < b.lmdt ? 1 : -1)))
+ );
+ }
+ );
+ }
}
const handleChangePage = (_event: unknown, newPage: number) => {