Skip to content

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

fix in web create index on readonly locations

sytolk92e314ca4ccc
diff --git a/src/renderer/hooks/LocationIndexContextProvider.tsx b/src/renderer/hooks/LocationIndexContextProvider.tsx
index 8a65228c2..f85fa9c66 100644
--- a/src/renderer/hooks/LocationIndexContextProvider.tsx
+++ b/src/renderer/hooks/LocationIndexContextProvider.tsx
@@ -313,20 +313,20 @@ export const LocationIndexContextProvider = ({
ignorePatterns,
isWalking,
)
- .then((directoryIndex) =>
- persistIndex(param, directoryIndex).then((success) => {
- if (success) {
- console.log('Index generated in folder: ' + dirPath);
- return enhanceDirectoryIndex(
- directoryIndex,
- param.locationID,
- param.path,
- );
- //return enhanceDirectoryIndex(param, directoryIndex, locationID);
- }
- return undefined;
- }),
- )
+ .then((directoryIndex) => {
+ if (!loc.isReadOnly) {
+ persistIndex(param, directoryIndex).then((success) => {
+ if (success) {
+ console.log('Index generated in folder: ' + dirPath);
+ }
+ });
+ }
+ return enhanceDirectoryIndex(
+ directoryIndex,
+ param.locationID,
+ param.path,
+ );
+ })
.catch((err) => {
console.log('Error creating index: ', err);
});