Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix For When user selects Empty files using File Upload #3051

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion reflex/.templates/web/utils/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,13 @@ export const applyEvent = async (event, socket) => {
*/
export const applyRestEvent = async (event, socket) => {
let eventSent = false;
if (event.handler == "uploadFiles") {
if (event.handler === "uploadFiles") {

if (event.payload.files === undefined || event.payload.files.length === 0){
// Submit the event over the websocket to trigger the event handler.
return await applyEvent(Event(event.name), socket)
}

// Start upload, but do not wait for it, which would block other events.
uploadFiles(
event.name,
Expand Down