Skip to content

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

Fix scrolling issue on readonly s3 buckets (#2182)

Stanimir0b53708619c2
diff --git a/package-lock.json b/package-lock.json
index da32fc2a9..02b64d8b4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -19,11 +19,11 @@
"@mui/lab": "5.0.0-alpha.170",
"@mui/material": "^5.15.19",
"@mui/x-date-pickers": "^5.0.20",
- "@tagspaces/tagspaces-common": "4.5.19",
- "@tagspaces/tagspaces-common-aws3": "4.5.19",
- "@tagspaces/tagspaces-common-cordova": "4.5.19",
- "@tagspaces/tagspaces-indexer": "4.5.19",
- "@tagspaces/tagspaces-md": "4.5.18",
+ "@tagspaces/tagspaces-common": "4.5.22",
+ "@tagspaces/tagspaces-common-aws3": "4.5.22",
+ "@tagspaces/tagspaces-common-cordova": "4.5.22",
+ "@tagspaces/tagspaces-indexer": "4.5.22",
+ "@tagspaces/tagspaces-md": "4.5.19",
"aws-amplify": "^4.3.8",
"classnames": "^2.3.1",
"clone": "^2.1.2",
@@ -17140,9 +17140,9 @@
}
},
"node_modules/@tagspaces/tagspaces-common": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common/-/tagspaces-common-4.5.19.tgz",
- "integrity": "sha512-cuSFo/s/BSgGZHZnzoA7WbvMMAGgCWFfbO/QZlgaF8og4xCrBmQoqSVk6W36pCir+KiZFSvwYHKw8dLVUBqUGg==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common/-/tagspaces-common-4.5.22.tgz",
+ "integrity": "sha512-XbWQNayNJL/X/VCDCRh1e78v1WjdQdANyJEUpvy4Rb2BBFsPp9LIEpO4PxQDjZL3uRnh02hIosOA2jM3H4iejA==",
"dependencies": {
"dotenv": "^16.0.2",
"picomatch": "^3.0.1",
@@ -17150,23 +17150,23 @@
}
},
"node_modules/@tagspaces/tagspaces-common-aws3": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-aws3/-/tagspaces-common-aws3-4.5.19.tgz",
- "integrity": "sha512-8CKaeBU1jl6huPFaLnwBsEtvqtpcZDB8Ir4icm65ffC8Hyunm7/vaDdb590gsB7maYv2uCivGka3FAC96uYc9w==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-aws3/-/tagspaces-common-aws3-4.5.22.tgz",
+ "integrity": "sha512-LPv4gKJy5D9GfbznJz8ig5hLAe7Hcyve79dzxx47QvtBD72dYkHIGqn6t5Bz8w3vR/sjAU3xwASy5pHFT/tgIQ==",
"dependencies": {
"@aws-sdk/client-s3": "^3.624.0",
"@aws-sdk/lib-storage": "^3.624.0",
"@aws-sdk/s3-request-presigner": "^3.624.0",
- "@tagspaces/tagspaces-common": "^4.5.19",
+ "@tagspaces/tagspaces-common": "^4.5.22",
"crypto-js": "^4.2.0"
}
},
"node_modules/@tagspaces/tagspaces-common-cordova": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-cordova/-/tagspaces-common-cordova-4.5.19.tgz",
- "integrity": "sha512-ioEiiZXpewxi7OZJK0FCPdD+xRG/Zman3pSLLyTCQh++Haap8fIRXNJyjzCzrJYdyFT0qFrOUIBl6NCFgl6qjg==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-cordova/-/tagspaces-common-cordova-4.5.22.tgz",
+ "integrity": "sha512-sQKk8oyMp2XaVJDCmu9tGEctmhhjc+W11RxYeE3pTo4emPhduZujFM9oII3B78LPCLt3wEYcLTENxh39gYPl4A==",
"dependencies": {
- "@tagspaces/tagspaces-common": "^4.5.19"
+ "@tagspaces/tagspaces-common": "^4.5.22"
}
},
"node_modules/@tagspaces/tagspaces-common/node_modules/uuid": {
@@ -17178,17 +17178,17 @@
}
},
"node_modules/@tagspaces/tagspaces-indexer": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-indexer/-/tagspaces-indexer-4.5.19.tgz",
- "integrity": "sha512-w7308cY1jXDgMGUl6sYfRMQiSw6miLcDK+dnOymzl0fmKcua6W+gURUr/OqcVYCGbjTi/hlUhT0qn7zrlG5u6g==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-indexer/-/tagspaces-indexer-4.5.22.tgz",
+ "integrity": "sha512-psX0+2UzSnVHJkYiuJHkNPL5SVjUwstXeR2982OlW37lZSBQfK7ID+lf/7AXKPl7O81cwc4fM4yH+GAcJCuFEg==",
"dependencies": {
- "@tagspaces/tagspaces-common": "^4.5.19"
+ "@tagspaces/tagspaces-common": "^4.5.22"
}
},
"node_modules/@tagspaces/tagspaces-md": {
- "version": "4.5.18",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-md/-/tagspaces-md-4.5.18.tgz",
- "integrity": "sha512-MDLoiDw9B9N0ZSKoqxs/CjQZu7llz76imGJdDi1HcESGCencbBNmpMyc+6r99zvqTUOBMbV1R3K35CTgNWz9Jw==",
+ "version": "4.5.19",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-md/-/tagspaces-md-4.5.19.tgz",
+ "integrity": "sha512-c9h+3SAYwniW7BDwR0Ezd8fFnjoJSKxLD99i2ZrtB7ZNg11rgiyiYaM5E/ynDWKM0FcI0FsAnXmuVeYrvaCiPA==",
"dependencies": {
"@milkdown/core": "7.3.6",
"@milkdown/ctx": "7.3.6",
diff --git a/package.json b/package.json
index 9b98cf8cd..b57f1762f 100644
--- a/package.json
+++ b/package.json
@@ -166,11 +166,11 @@
"@mui/lab": "5.0.0-alpha.170",
"@mui/material": "^5.15.19",
"@mui/x-date-pickers": "^5.0.20",
- "@tagspaces/tagspaces-common": "4.5.19",
- "@tagspaces/tagspaces-common-aws3": "4.5.19",
- "@tagspaces/tagspaces-common-cordova": "4.5.19",
- "@tagspaces/tagspaces-indexer": "4.5.19",
- "@tagspaces/tagspaces-md": "4.5.18",
+ "@tagspaces/tagspaces-common": "4.5.22",
+ "@tagspaces/tagspaces-common-aws3": "4.5.22",
+ "@tagspaces/tagspaces-common-cordova": "4.5.22",
+ "@tagspaces/tagspaces-indexer": "4.5.22",
+ "@tagspaces/tagspaces-md": "4.5.19",
"aws-amplify": "^4.3.8",
"classnames": "^2.3.1",
"clone": "^2.1.2",
diff --git a/release/app/package-lock.json b/release/app/package-lock.json
index 679cd1cc4..ef1ff2f29 100644
--- a/release/app/package-lock.json
+++ b/release/app/package-lock.json
@@ -11,9 +11,9 @@
"license": "AGPL-3.0",
"dependencies": {
"@elife/pm2": "3.6.1",
- "@tagspaces/extensions": "1.0.131",
- "@tagspaces/tagspaces-common-node": "4.5.19",
- "@tagspaces/tagspaces-ws": "4.5.19",
+ "@tagspaces/extensions": "1.0.132",
+ "@tagspaces/tagspaces-common-node": "4.5.22",
+ "@tagspaces/tagspaces-ws": "4.5.22",
"sharp": "0.32.6",
"ws": "8.16.0"
},
@@ -30,9 +30,9 @@
}
},
"node_modules/@tagspaces/extensions": {
- "version": "1.0.131",
- "resolved": "https://registry.npmjs.org/@tagspaces/extensions/-/extensions-1.0.131.tgz",
- "integrity": "sha512-GulzZ0E5IdbChaDJd1nd6I7NKD5Se6LqvGQu/kxLT388uD9HXTiW5zJ7zTi0DN55CyZrW1VPx/MGs7Wu6QJpJA==",
+ "version": "1.0.132",
+ "resolved": "https://registry.npmjs.org/@tagspaces/extensions/-/extensions-1.0.132.tgz",
+ "integrity": "sha512-u1RBareNTv3CKV30j8647liWQ1GtgjpJR5jneueFzV9Q81UJ2FGxHhvjwMgBaEuwQgU6yWZ89oTHWiBG8TnZng==",
"dependencies": {
"shelljs": "^0.8.5",
"shx": "^0.3.4"
@@ -43,9 +43,9 @@
}
},
"node_modules/@tagspaces/tagspaces-common": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common/-/tagspaces-common-4.5.19.tgz",
- "integrity": "sha512-cuSFo/s/BSgGZHZnzoA7WbvMMAGgCWFfbO/QZlgaF8og4xCrBmQoqSVk6W36pCir+KiZFSvwYHKw8dLVUBqUGg==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common/-/tagspaces-common-4.5.22.tgz",
+ "integrity": "sha512-XbWQNayNJL/X/VCDCRh1e78v1WjdQdANyJEUpvy4Rb2BBFsPp9LIEpO4PxQDjZL3uRnh02hIosOA2jM3H4iejA==",
"dependencies": {
"dotenv": "^16.0.2",
"picomatch": "^3.0.1",
@@ -53,11 +53,11 @@
}
},
"node_modules/@tagspaces/tagspaces-common-node": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-node/-/tagspaces-common-node-4.5.19.tgz",
- "integrity": "sha512-NalixXlYBDTymE7OVobgGWsaoATGcsELQTCe5Lmj/qldRZxF0+pn7XCvMv4koLduJbQ9/qhwizqpZkDtIpuHSw==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-node/-/tagspaces-common-node-4.5.22.tgz",
+ "integrity": "sha512-SxzRbHs3kYqZuK4yNLRZli4Ei67bPFv0OH+IHlDONVzEZFm9hIRF0vNMqKJ3OuzQW182FZAwbSOWskSeFbeAyQ==",
"dependencies": {
- "@tagspaces/tagspaces-common": "^4.5.19",
+ "@tagspaces/tagspaces-common": "^4.5.22",
"adm-zip": "0.5.10",
"fs-extra": "^10.0.0",
"klaw": "^4.1.0",
@@ -74,22 +74,22 @@
}
},
"node_modules/@tagspaces/tagspaces-workers": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-workers/-/tagspaces-workers-4.5.19.tgz",
- "integrity": "sha512-FXmc/TMSOkLZdV7uDyHjlegWEe35Nv7xRhRBuSqwo+NiQ8HCWXKFxlSV+PPoclXsie6stOtMseJDDW+0Wq4MoQ==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-workers/-/tagspaces-workers-4.5.22.tgz",
+ "integrity": "sha512-cSPbSAC28OJPscnViw+lxXHswEwussm4bgH3UxJp0kZtewUTxxkG7R2ifu7RRVuulka6gE9jws1ePcwuZSyuAw==",
"dependencies": {
- "@tagspaces/tagspaces-common": "^4.5.19",
- "@tagspaces/tagspaces-common-node": "^4.5.19",
+ "@tagspaces/tagspaces-common": "^4.5.22",
+ "@tagspaces/tagspaces-common-node": "^4.5.22",
"@tagspaces/tagspaces-thumbgen-image": "^4.2.3",
- "fswin": "^3.24.524"
+ "fswin": "^3.24.829"
}
},
"node_modules/@tagspaces/tagspaces-ws": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-ws/-/tagspaces-ws-4.5.19.tgz",
- "integrity": "sha512-T/fKK8HlHcgOYNOEdLzfowqeN53ZX71gmwAX0i5BNS8Ivcj+GLm1FJd7jO7yT9hTqLeHlntmuqVPHX7v95L5TA==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-ws/-/tagspaces-ws-4.5.22.tgz",
+ "integrity": "sha512-51q5fKClV7h7vtrbBTvXOPfkqeFyHdWmrhj6zSTKF8tG0iSP4Q/Z1PC7afPNatjI//2HhALUyXw2lV18vJR5aw==",
"dependencies": {
- "@tagspaces/tagspaces-workers": "^4.5.19",
+ "@tagspaces/tagspaces-workers": "^4.5.22",
"find-free-ports": "^3.1.1",
"jsonwebtoken": "^8.5.1",
"ws": "^8.15.1"
@@ -1122,18 +1122,18 @@
}
},
"@tagspaces/extensions": {
- "version": "1.0.131",
- "resolved": "https://registry.npmjs.org/@tagspaces/extensions/-/extensions-1.0.131.tgz",
- "integrity": "sha512-GulzZ0E5IdbChaDJd1nd6I7NKD5Se6LqvGQu/kxLT388uD9HXTiW5zJ7zTi0DN55CyZrW1VPx/MGs7Wu6QJpJA==",
+ "version": "1.0.132",
+ "resolved": "https://registry.npmjs.org/@tagspaces/extensions/-/extensions-1.0.132.tgz",
+ "integrity": "sha512-u1RBareNTv3CKV30j8647liWQ1GtgjpJR5jneueFzV9Q81UJ2FGxHhvjwMgBaEuwQgU6yWZ89oTHWiBG8TnZng==",
"requires": {
"shelljs": "^0.8.5",
"shx": "^0.3.4"
}
},
"@tagspaces/tagspaces-common": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common/-/tagspaces-common-4.5.19.tgz",
- "integrity": "sha512-cuSFo/s/BSgGZHZnzoA7WbvMMAGgCWFfbO/QZlgaF8og4xCrBmQoqSVk6W36pCir+KiZFSvwYHKw8dLVUBqUGg==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common/-/tagspaces-common-4.5.22.tgz",
+ "integrity": "sha512-XbWQNayNJL/X/VCDCRh1e78v1WjdQdANyJEUpvy4Rb2BBFsPp9LIEpO4PxQDjZL3uRnh02hIosOA2jM3H4iejA==",
"requires": {
"dotenv": "^16.0.2",
"picomatch": "^3.0.1",
@@ -1141,11 +1141,11 @@
}
},
"@tagspaces/tagspaces-common-node": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-node/-/tagspaces-common-node-4.5.19.tgz",
- "integrity": "sha512-NalixXlYBDTymE7OVobgGWsaoATGcsELQTCe5Lmj/qldRZxF0+pn7XCvMv4koLduJbQ9/qhwizqpZkDtIpuHSw==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-common-node/-/tagspaces-common-node-4.5.22.tgz",
+ "integrity": "sha512-SxzRbHs3kYqZuK4yNLRZli4Ei67bPFv0OH+IHlDONVzEZFm9hIRF0vNMqKJ3OuzQW182FZAwbSOWskSeFbeAyQ==",
"requires": {
- "@tagspaces/tagspaces-common": "^4.5.19",
+ "@tagspaces/tagspaces-common": "^4.5.22",
"adm-zip": "0.5.10",
"fs-extra": "^10.0.0",
"klaw": "^4.1.0",
@@ -1162,22 +1162,22 @@
}
},
"@tagspaces/tagspaces-workers": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-workers/-/tagspaces-workers-4.5.19.tgz",
- "integrity": "sha512-FXmc/TMSOkLZdV7uDyHjlegWEe35Nv7xRhRBuSqwo+NiQ8HCWXKFxlSV+PPoclXsie6stOtMseJDDW+0Wq4MoQ==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-workers/-/tagspaces-workers-4.5.22.tgz",
+ "integrity": "sha512-cSPbSAC28OJPscnViw+lxXHswEwussm4bgH3UxJp0kZtewUTxxkG7R2ifu7RRVuulka6gE9jws1ePcwuZSyuAw==",
"requires": {
- "@tagspaces/tagspaces-common": "^4.5.19",
- "@tagspaces/tagspaces-common-node": "^4.5.19",
+ "@tagspaces/tagspaces-common": "^4.5.22",
+ "@tagspaces/tagspaces-common-node": "^4.5.22",
"@tagspaces/tagspaces-thumbgen-image": "^4.2.3",
- "fswin": "^3.24.524"
+ "fswin": "^3.24.829"
}
},
"@tagspaces/tagspaces-ws": {
- "version": "4.5.19",
- "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-ws/-/tagspaces-ws-4.5.19.tgz",
- "integrity": "sha512-T/fKK8HlHcgOYNOEdLzfowqeN53ZX71gmwAX0i5BNS8Ivcj+GLm1FJd7jO7yT9hTqLeHlntmuqVPHX7v95L5TA==",
+ "version": "4.5.22",
+ "resolved": "https://registry.npmjs.org/@tagspaces/tagspaces-ws/-/tagspaces-ws-4.5.22.tgz",
+ "integrity": "sha512-51q5fKClV7h7vtrbBTvXOPfkqeFyHdWmrhj6zSTKF8tG0iSP4Q/Z1PC7afPNatjI//2HhALUyXw2lV18vJR5aw==",
"requires": {
- "@tagspaces/tagspaces-workers": "^4.5.19",
+ "@tagspaces/tagspaces-workers": "^4.5.22",
"find-free-ports": "^3.1.1",
"jsonwebtoken": "^8.5.1",
"ws": "^8.15.1"
diff --git a/release/app/package.json b/release/app/package.json
index 0b83bd262..ebaac9716 100644
--- a/release/app/package.json
+++ b/release/app/package.json
@@ -18,9 +18,9 @@
},
"dependencies": {
"@elife/pm2": "3.6.1",
- "@tagspaces/extensions": "1.0.131",
- "@tagspaces/tagspaces-common-node": "4.5.19",
- "@tagspaces/tagspaces-ws": "4.5.19",
+ "@tagspaces/extensions": "1.0.132",
+ "@tagspaces/tagspaces-common-node": "4.5.22",
+ "@tagspaces/tagspaces-ws": "4.5.22",
"sharp": "0.32.6",
"ws": "8.16.0"
},
diff --git a/src/renderer/hooks/IOActionsContextProvider.tsx b/src/renderer/hooks/IOActionsContextProvider.tsx
index 6e15ee0d8..3eb8b8755 100644
--- a/src/renderer/hooks/IOActionsContextProvider.tsx
+++ b/src/renderer/hooks/IOActionsContextProvider.tsx
@@ -1574,8 +1574,10 @@ export const IOActionsContextProvider = ({
{ path: metaFilePath, locationID: entry.locationID },
content,
true,
- ).then(() => {
- reflectUpdateSidecarMeta(entry.path, meta);
+ ).then((success) => {
+ if (success) {
+ reflectUpdateSidecarMeta(entry.path, meta);
+ }
return meta;
});
}
@@ -1623,7 +1625,12 @@ export const IOActionsContextProvider = ({
{ path: metaFilePath, locationID: location.uuid },
JSON.stringify(mataData),
true,
- ).then(() => mataData);
+ )
+ .then(() => mataData)
+ .catch((e) => {
+ console.error(e);
+ return mataData;
+ });
});
}
diff --git a/src/renderer/hooks/LocationIndexContextProvider.tsx b/src/renderer/hooks/LocationIndexContextProvider.tsx
index 182c72caa..885dec999 100644
--- a/src/renderer/hooks/LocationIndexContextProvider.tsx
+++ b/src/renderer/hooks/LocationIndexContextProvider.tsx
@@ -685,28 +685,32 @@ export const LocationIndexContextProvider = ({
}
const metaDirectory = getMetaDirectoryPath(directoryPath);
const exist = await currentLocation.checkDirExist(metaDirectory);
- if (!exist) {
- await currentLocation.createDirectoryPromise(metaDirectory); // todo platformFacade?
+ try {
+ if (!exist) {
+ await currentLocation.createDirectoryPromise(metaDirectory); // todo platformFacade?
+ }
+ const folderIndexPath =
+ metaDirectory +
+ currentLocation?.getDirSeparator() +
+ AppConfig.folderIndexFile; // getMetaIndexFilePath(directoryPath);
+ return currentLocation
+ .saveTextFilePromise(
+ { ...param, path: folderIndexPath },
+ JSON.stringify(directoryIndex), // relativeIndex),
+ true,
+ )
+ .then(() => {
+ console.log(
+ 'Index persisted for: ' + directoryPath + ' to ' + folderIndexPath,
+ );
+ return true;
+ })
+ .catch((err) => {
+ console.log('Error saving the index for ' + folderIndexPath, err);
+ });
+ } catch (e) {
+ console.log('Error saving the index', e);
}
- const folderIndexPath =
- metaDirectory +
- currentLocation?.getDirSeparator() +
- AppConfig.folderIndexFile; // getMetaIndexFilePath(directoryPath);
- return currentLocation
- .saveTextFilePromise(
- { ...param, path: folderIndexPath },
- JSON.stringify(directoryIndex), // relativeIndex),
- true,
- )
- .then(() => {
- console.log(
- 'Index persisted for: ' + directoryPath + ' to ' + folderIndexPath,
- );
- return true;
- })
- .catch((err) => {
- console.log('Error saving the index for ' + folderIndexPath, err);
- });
}
function enhanceDirectoryIndex(
diff --git a/src/renderer/hooks/PlatformFacadeContextProvider.tsx b/src/renderer/hooks/PlatformFacadeContextProvider.tsx
index 3b7bf545a..46d25e1fc 100644
--- a/src/renderer/hooks/PlatformFacadeContextProvider.tsx
+++ b/src/renderer/hooks/PlatformFacadeContextProvider.tsx
@@ -194,7 +194,10 @@ export const PlatformFacadeContextProvider = ({
return getLocation({ locationID })
.createDirectoryPromise(path)
.then((result) => {
- reflectAddEntry(currentLocation.toFsEntry(path, false));
+ if (result !== undefined) {
+ // do not reflect if directory not created
+ reflectAddEntry(currentLocation.toFsEntry(path, false));
+ }
deignoreByWatcher(path);
return result;
});
diff --git a/src/renderer/hooks/ThumbGenerationContextProvider.tsx b/src/renderer/hooks/ThumbGenerationContextProvider.tsx
index d13c7926c..1caf1e0b4 100644
--- a/src/renderer/hooks/ThumbGenerationContextProvider.tsx
+++ b/src/renderer/hooks/ThumbGenerationContextProvider.tsx
@@ -185,7 +185,11 @@ export const ThumbGenerationContextProvider = ({
return Promise.resolve(false);
}
const location: CommonLocation = findLocation(dirEntries[0].locationID);
- if (!location || location.disableThumbnailGeneration === true) {
+ if (
+ !location ||
+ location.disableThumbnailGeneration === true ||
+ location.isReadOnly
+ ) {
return Promise.resolve(false); // dont generate thumbnails if it's not enabled in location settings
}
if (!genThumbnailsEnabled(location)) {
diff --git a/src/renderer/utils/CommonLocation.ts b/src/renderer/utils/CommonLocation.ts
index 3af87a44b..15f7be604 100644
--- a/src/renderer/utils/CommonLocation.ts
+++ b/src/renderer/utils/CommonLocation.ts
@@ -422,6 +422,9 @@ export class CommonLocation implements TS.Location {
};
createDirectoryPromise = (dirPath: string): Promise<any> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (this.ioAPI) {
if (this.haveObjectStoreSupport()) {
return this.ioAPI.createDirectoryPromise({
@@ -444,6 +447,9 @@ export class CommonLocation implements TS.Location {
sourceFilePath: string,
targetFilePath: string,
): Promise<any> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (this.ioAPI) {
if (this.haveObjectStoreSupport()) {
return this.ioAPI.copyFilePromise(
@@ -533,6 +539,9 @@ export class CommonLocation implements TS.Location {
newDirPath: string,
onProgress = undefined,
): Promise<any> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (this.ioAPI) {
if (this.haveObjectStoreSupport()) {
return this.ioAPI.copyDirectoryPromise(
@@ -563,6 +572,9 @@ export class CommonLocation implements TS.Location {
newDirPath: string,
onProgress = undefined,
): Promise<any> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (this.ioAPI) {
if (this.haveObjectStoreSupport()) {
return this.ioAPI.moveDirectoryPromise(
@@ -593,6 +605,9 @@ export class CommonLocation implements TS.Location {
content: any,
overwrite: boolean,
): Promise<any> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (this.ioAPI) {
if (this.haveObjectStoreSupport()) {
return this.ioAPI.saveFilePromise(
@@ -623,6 +638,9 @@ export class CommonLocation implements TS.Location {
content: string,
overwrite: boolean,
): Promise<any> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (this.ioAPI) {
if (this.haveObjectStoreSupport()) {
return this.ioAPI.saveTextFilePromise(
@@ -657,6 +675,9 @@ export class CommonLocation implements TS.Location {
response: any, // AWS.Response<AWS.S3.PutObjectOutput, AWS.AWSError>
) => void,
): Promise<TS.FileSystemEntry> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (this.ioAPI) {
if (this.haveObjectStoreSupport()) {
return this.ioAPI.saveBinaryFilePromise(
@@ -702,6 +723,9 @@ export class CommonLocation implements TS.Location {
};
deleteFilePromise = (path: string, useTrash?: boolean): Promise<any> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (this.ioAPI) {
if (this.haveObjectStoreSupport()) {
return this.ioAPI.deleteFilePromise({
@@ -722,6 +746,9 @@ export class CommonLocation implements TS.Location {
};
deleteDirectoryPromise = (path: string, useTrash?: boolean): Promise<any> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (this.ioAPI) {
if (this.haveObjectStoreSupport()) {
return this.ioAPI.deleteDirectoryPromise({
@@ -817,6 +844,9 @@ export class CommonLocation implements TS.Location {
extractText: boolean,
ignorePatterns: Array<string>,
): Promise<any> => {
+ if (this.isReadOnly) {
+ return Promise.reject(new Error('read only Location'));
+ }
if (
AppConfig.isElectron &&
!this.haveObjectStoreSupport() &&
diff --git a/tests/e2e/folderprops.pw.e2e.js b/tests/e2e/folderprops.pw.e2e.js
index e75521811..5fa62f6a5 100644
--- a/tests/e2e/folderprops.pw.e2e.js
+++ b/tests/e2e/folderprops.pw.e2e.js
@@ -205,9 +205,15 @@ test.describe('TST02 - Folder properties', () => {
8000,
'[data-tid=perspectiveGridFileTable]',
);
+ await expectElementExist(
+ '[data-tid=tagContainer_' + tagName + ']',
+ true,
+ 8000,
+ '[data-tid=PropertiesTagsSelectTID]',
+ );
- const propsTags = await getPropertiesTags();
- expect(propsTags).toContain(tagName);
+ //const propsTags = await getPropertiesTags();
+ //expect(propsTags).toContain(tagName);
});
test('TST0213 - Add description to folder [web,electron,_pro]', async () => {