Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyi_hashes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"reflex/__init__.pyi": "0a3ae880e256b9fd3b960e12a2cb51a7",
"reflex/__init__.pyi": "a0266c47111e9af7f340186013c7a31e",
"reflex/components/__init__.pyi": "ac05995852baa81062ba3d18fbc489fb",
"reflex/components/base/__init__.pyi": "16e47bf19e0d62835a605baa3d039c5a",
"reflex/components/base/app_wrap.pyi": "22e94feaa9fe675bcae51c412f5b67f1",
Expand All @@ -19,7 +19,7 @@
"reflex/components/core/helmet.pyi": "cb5ac1be02c6f82fcc78ba74651be593",
"reflex/components/core/html.pyi": "4ebe946f3fc097fc2e31dddf7040ec1c",
"reflex/components/core/sticky.pyi": "cb763b986a9b0654d1a3f33440dfcf60",
"reflex/components/core/upload.pyi": "c90782be1b63276b428bce3fd4ce0af2",
"reflex/components/core/upload.pyi": "ca9f7424f3b74b1b56f5c819e8654eeb",
"reflex/components/core/window_events.pyi": "e7af4bf5341c4afaf60c4a534660f68f",
"reflex/components/datadisplay/__init__.pyi": "52755871369acbfd3a96b46b9a11d32e",
"reflex/components/datadisplay/code.pyi": "1d123d19ef08f085422f3023540e7bb1",
Expand Down
5 changes: 1 addition & 4 deletions reflex/.templates/web/utils/helpers/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ export const uploadFiles = async (
getBackendURL,
getToken,
) => {
// return if there's no file to upload
if (files === undefined || files.length === 0) {
return false;
}
files = files ?? [];

const upload_ref_name = `__upload_controllers_${upload_id}`;

Expand Down
10 changes: 0 additions & 10 deletions reflex/.templates/web/utils/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,6 @@ export const applyEvent = async (event, socket, navigate, params) => {
export const applyRestEvent = async (event, socket, navigate, params) => {
let eventSent = false;
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(
ReflexEvent(event.name, { files: [] }),
socket,
navigate,
params,
);
}

// Start upload, but do not wait for it, which would block other events.
uploadFiles(
event.name,
Expand Down
5 changes: 5 additions & 0 deletions reflex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@
"config": ["Config", "DBConfig"],
"constants": ["Env"],
"constants.colors": ["Color"],
"_upload": [
"UploadChunk",
"UploadChunkIterator",
],
"event": [
"event",
"EventChain",
Expand All @@ -320,6 +324,7 @@
"set_value",
"stop_propagation",
"upload_files",
"upload_files_chunk",
"window_alert",
],
"istate.storage": [
Expand Down
Loading
Loading