Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/extension/ipc/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,9 @@ const registerCollectionIpc = (watcher: CollectionWatcherInterface): void => {
}

validatePathIsInsideCollection(sourcePathname);
const sourceIsDirectory = fs.statSync(sourcePathname).isDirectory();
const collectionPath = findCollectionPathByItemPath(sourcePathname);
const collectionUid = collectionPath ? generateUidBasedOnHash(collectionPath) : null;

const sourceDirname = path.dirname(sourcePathname);
const pathnamesBefore = await getPaths(sourcePathname);
Expand All @@ -794,6 +797,12 @@ const registerCollectionIpc = (watcher: CollectionWatcherInterface): void => {
pathnamesAfter?.forEach((_, index) => {
moveRequestUid(pathnamesBefore[index], pathnamesAfter[index]);
});
if (sourceIsDirectory && collectionUid) {
broadcastToAllWebviews('main:collection-tree-updated', 'unlinkDir', {
directory: { pathname: posixifyPath(sourcePathname) },
meta: { collectionUid }
});
}

return { success: true };
} catch (error) {
Expand Down