Skip to content

Commit 93b50fd

Browse files
committed
course: fix little issue with add handouts
1 parent 281c9a9 commit 93b50fd

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/packages/frontend/course/assignments/assignments-panel.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,16 @@ export const AssignmentsPanel: React.FC<Props> = React.memo((props: Props) => {
308308
});
309309

310310
// used for adding assignments outside of the above component.
311-
export function AddAssignments({ name, actions }) {
311+
export function AddAssignments({ name, actions, close }) {
312312
const assignments = useRedux(name, "assignments");
313313
return (
314314
<AddItems
315315
itemName="assignment"
316316
items={assignments}
317-
addItems={actions.assignments.addAssignment}
317+
addItems={(paths) => {
318+
actions.assignments.addAssignment(paths);
319+
close?.();
320+
}}
318321
selectorStyle={{
319322
position: null,
320323
width: "100%",

src/packages/frontend/course/handouts/handouts-panel.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,16 @@ export function HandoutsPanelHeader(props: { n: number }) {
239239
}
240240

241241
// used for adding assignments outside of the above component.
242-
export function AddHandouts({ name, actions }) {
242+
export function AddHandouts({ name, actions, close }) {
243243
const handouts = useRedux(name, "handouts");
244244
return (
245245
<AddItems
246246
itemName="handout"
247247
items={handouts}
248-
addItems={actions.assignments.addHandout}
248+
addItems={(paths) => {
249+
actions.handouts.addHandout(paths);
250+
close?.();
251+
}}
249252
selectorStyle={{
250253
position: null,
251254
width: "100%",

0 commit comments

Comments
 (0)