From 96b6769326b581e06a13001259956b30e90ed79a Mon Sep 17 00:00:00 2001 From: Abhinav Date: Tue, 6 Sep 2022 15:40:49 +0530 Subject: [PATCH] fix getCollectionNameAndFolderPath --- src/services/watchFolder/watchFolderService.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/services/watchFolder/watchFolderService.ts b/src/services/watchFolder/watchFolderService.ts index a0e167298..3ae9b85dc 100644 --- a/src/services/watchFolder/watchFolderService.ts +++ b/src/services/watchFolder/watchFolderService.ts @@ -580,8 +580,11 @@ class watchFolderService { try { const mappings = this.getWatchMappings(); - const mapping = mappings.find((mapping) => - filePath.startsWith(mapping.folderPath) + const mapping = mappings.find( + (mapping) => + filePath.length > mapping.folderPath.length && + filePath.startsWith(mapping.folderPath) && + filePath[filePath.length] === '/' ); if (!mapping) {