From fe99235f8dcffd3d71f020c1a06e91855a4655de Mon Sep 17 00:00:00 2001 From: Artem Grinev Date: Wed, 11 Dec 2024 14:50:09 +0000 Subject: [PATCH] fix(web): set package section on add Fixes #157 --- web/src/modals/CommitModal.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/src/modals/CommitModal.tsx b/web/src/modals/CommitModal.tsx index 45c06b9..086470e 100644 --- a/web/src/modals/CommitModal.tsx +++ b/web/src/modals/CommitModal.tsx @@ -59,8 +59,15 @@ export const CommitModal = forwardRef( const { toAdd, toDelete, toMove, toCopy } = commit || {}; const commitCallback = useCallback(() => { - if (props.onCommitSubmit && commit && section) + if (props.onCommitSubmit && commit && section) { + if (toAdd) { + for (const [_, pkg] of toAdd) { + pkg.section = section; + } + } + props.onCommitSubmit(section, commit); + } }, [commit, props, section]); const packageDropHandler = usePackageDropHandler(section, (_, toAdd) =>