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 file upload bug in DelegatePaperView #764

Open
srisainachuri opened this issue Jul 20, 2021 · 3 comments
Open

Fix file upload bug in DelegatePaperView #764

srisainachuri opened this issue Jul 20, 2021 · 3 comments

Comments

@srisainachuri
Copy link
Contributor

srisainachuri commented Jul 20, 2021

For some files, especially larger ones, uploading position papers will error and not successfully upload. Most likely cause of issue is history.redirect refreshes the page before the upload actually finishes.

Code pointers:
DelegatePaperView.js

@erwang01
Copy link
Member

We can consider moving history.redirect to inside the upload callback function.

_handleSuccess = (response) => {
window.alert("Your paper has been successfully uploaded!");
};

This way we only redirect upon success. However #785 is probably a better way of doing things.

@srisainachuri
Copy link
Contributor Author

srisainachuri commented Jan 15, 2022

Moving the history.redirect works! #785 is probably cleaner, currently looking into why the existing listener doesn't suffice.

@erwang01
Copy link
Member

_handleSuccess doesn't seem to change the state at all. Try moving this into _handleSuccess?

this.setState({
uploadedFile: null,
});

I'm not entirely sure what the purpose of resetting this state is but I guess it lets the user upload a new file if they want to change it?

Also what does a listener do again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants