-
-
Notifications
You must be signed in to change notification settings - Fork 828
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
[Bug] getFiles return the old serverId on revert or undo of file in event onprocessfilerevert #1014
Comments
I'm not sure what you mean. From the code snippet it's unclear how you're setting the |
Problem is not that I am not getting the serverId but problem is getFiles doesn't give the files synchronously in case of onprocessfilerevert event. After some delay we call getFiles then it return the correct files (here I mean serverId) ` revert: async (imageId, load, error) => {
|
Have you set |
no |
Is there an existing issue for this?
Have you updated FilePond and its plugins?
Describe the bug
This is filepond react code. I am getting the old serverIds value of file instead of null. But when I do setTimeout of 1sec and then execute getFiles then it give me updated file (serverId as null which is expected one after revert or undo).
onprocessfilerevert={(file: FilePondFile) => { const serverIds = filePondRef.current?.getFiles().filter((file: FilePondFile) => file.serverId); console.log(serverIds) }}
Reproduction
`import { FilePond, registerPlugin } from 'react-filepond';
<FilePond
onprocessfilerevert={(file: FilePondFile) => {
const serverIds = filePondRef.current?.getFiles().filter((file: FilePondFile) => file.serverId);
console.log(serverIds) // this should return [null]
}}
/>`
Environment
The text was updated successfully, but these errors were encountered: