veliovgroup / Meteor-Files

🚀 Upload files via DDP or HTTP to ☄️ Meteor server FS, AWS, GridFS, DropBox or Google Drive. Fast, secure and robust.
https://packosphere.com/ostrio/files
BSD 3-Clause "New" or "Revised" License
1.11k stars 167 forks source link

Autorefresh app when finished upload files #824

Closed Luvelnet closed 3 years ago

Luvelnet commented 3 years ago

Hello there:

I have noticed that when loading the files and submitting the form, the meteor application refreshes itself automatically. Can you control that? I think that it will be uncomfortable for the end user to automatically switch windows.

Thanks

jankapunkt commented 3 years ago

That is unlikely unless you have somehow configured WebApp routes missed to preventDefault the form submit event!? Can you post a minimal example for reproduction?

Luvelnet commented 3 years ago

There is my handleSubmit:

const handleSubmit = e => { e.preventDefault(); setTextDiaglog(""); Meteor.call('menus.new', menu); files.map(f => { Files.insert({file: f,chunkSize: 'dynamic'}, true); }); setOpenDiaglog(true); setTextDiaglog("File upload!"); };

I use routes for the web version with react-router.

dr-dimitru commented 3 years ago

@Luvelnet

return false;

at the end of the function

Luvelnet commented 3 years ago

From what I have been able to observe, if I change the folder where the files are uploaded by default, that happens and it refreshes automatically. Due to the urgency of the project, I have left the default folder, I will investigate it later.

Thanks for the help.