Skip to content

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

fix disable indexing

sytolkc2565a756fcf
diff --git a/src/renderer/hooks/LocationIndexContextProvider.tsx b/src/renderer/hooks/LocationIndexContextProvider.tsx
index f85fa9c66..03ab96e95 100644
--- a/src/renderer/hooks/LocationIndexContextProvider.tsx
+++ b/src/renderer/hooks/LocationIndexContextProvider.tsx
@@ -363,7 +363,7 @@ export const LocationIndexContextProvider = ({
}
function createLocationIndex(location: CommonLocation): Promise<boolean> {
- if (location) {
+ if (location && !location.disableIndexing) {
return getLocationPath(location).then((locationPath) => {
const isCurrentLocation =
currentLocation && currentLocation.uuid === location.uuid;
@@ -398,15 +398,17 @@ export const LocationIndexContextProvider = ({
async function createLocationsIndexes(extractText = true): Promise<boolean> {
for (let location of locations) {
try {
- const locationPath = await getLocationPath(location);
- isIndexing.current = locationPath;
- forceUpdate();
- await createDirectoryIndexWrapper(
- { path: locationPath, locationID: location.uuid },
- extractText,
- location.ignorePatternPaths,
- enableWS,
- );
+ if (!location.disableIndexing) {
+ const locationPath = await getLocationPath(location);
+ isIndexing.current = locationPath;
+ forceUpdate();
+ await createDirectoryIndexWrapper(
+ { path: locationPath, locationID: location.uuid },
+ extractText,
+ location.ignorePatternPaths,
+ enableWS,
+ );
+ }
} catch (error) {
console.error('An error occurred:', error);
}