Skip to content

Commit

Permalink
fix(web): set package section on add
Browse files Browse the repository at this point in the history
Fixes #157
  • Loading branch information
LordTermor committed Jan 11, 2025
1 parent 529e285 commit fe99235
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web/src/modals/CommitModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,15 @@ export const CommitModal = forwardRef<HTMLDialogElement, CommitModalProps>(
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) =>
Expand Down

0 comments on commit fe99235

Please sign in to comment.