fix file uploads iterable type - #1863
Open
coolgirl19 wants to merge 3 commits into
Open
Conversation
joschahenningsen
left a comment
Member
There was a problem hiding this comment.
Looks good, can you check why the linter is failing?
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes drag-and-drop attachment uploads in the lecture editor (issue #1842) by adjusting how dropped files are collected and by making attachment state updates more robust in the admin lecture list data store.
Changes:
- Update lecture editor drop handler to handle multiple dropped files and support both
DataTransfer.filesandDataTransfer.items. - Fix attachment list updates to handle potentially missing
filesand keephasAttachmentsconsistent on add/remove.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| web/ts/edit-course.ts | Adjusts drag-and-drop handling for lecture attachment uploads. |
| web/ts/data-store/admin-lecture-list.ts | Makes attachment add/remove resilient to missing files and updates hasAttachments accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+226
to
+230
| onAttachmentFileDrop(e) { | ||
| if (e.dataTransfer.items) { | ||
| const item = e.dataTransfer.items[0]; | ||
| const { kind } = item; | ||
| switch (kind) { | ||
| case "file": { | ||
| DataStore.adminLectureList.uploadAttachmentFile( | ||
| this.lectureData.courseId, | ||
| this.lectureData.lectureId, | ||
| item.getAsFile(), | ||
| ); | ||
| break; | ||
| } | ||
| const files = [...(e.dataTransfer?.files ?? [])]; | ||
|
|
||
| if (files.length > 0) { | ||
| for (const file of files) { |
Member
|
@coolgirl19 can you follow up on this PR please? |
Contributor
Author
|
Yes, I will do it.
Thanking You,
*Ananya Parikh*
…On Mon, 27 Jul 2026, 08:18 Joscha Henningsen, ***@***.***> wrote:
*joschahenningsen* left a comment (TUM-Dev/gocast#1863)
<#1863 (comment)>
@coolgirl19 <https://github.com/coolgirl19> can you follow up on this PR
please?
—
Reply to this email directly, view it on GitHub
<#1863?email_source=notifications&email_token=AIQNEY2H2DFYBSHU5TLI2BL5G3X25A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBYG44TIMZQGMZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5087943033>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIQNEYZP5L4VA3OW4U4OW7L5G3X25AVCNFSNUABFKJSXA33TNF2G64TZHMZTIMBTGA4DONRYHNEXG43VMU5TINZVG43TQOJRGE4KC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AIQNEY2KCYYJ3CEAE3XP5ET5G3X25A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBYG44TIMZQGMZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/AIQNEYYFXWLRCFY3XIXN3D35G3X25A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBYG44TIMZQGMZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Contributor
Author
|
@joschahenningsen I fixed the formatting issue and added the suggestion. Could you please take another look? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Description
Fixes #1842
Steps for Testing