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

File select cancellation fix + condition cleanup #197

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

jarmoza
Copy link
Contributor

@jarmoza jarmoza commented Oct 6, 2022

This bug fix addresses issue #194. Before, selecting a data table file (participants.tsv) and then attempting to select a second file but instead cancelling in the file select dialog resulted in a JS error and page crash.

Once this crash was initially addressed, it also revealed that the code would wipe the first data table selection (as well as its filename and file preview in the UI).

Neither of these issues occurred for the data dictionary file selection.

Expected behavior:

  • Page does not crash when second data table file selection attempt is cancelled
  • Currently selected data table is not wiped but remains after file select cancellation
  • Data dictionary file selection maintains consistent behavior with data table file selection

The above was addressed by creating a cleaner check against file select event's file data and by not resetting the file data variable if no new file has been selected. (See onFileSelected in file-selector.vue.)

I also cleaned up some conditional checks for possible values of the file data variable fileInput in file-selector. It's either null or has a valid value. And I removed the file-select event propagating back up to index.vue that was using the string "none" to indicate a file selection cancellation.

Copy link
Contributor

@surchs surchs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @jarmoza. This seems to be a MacOS specific bug, as I couldn't reproduce on Linux or Windows. Very interesting.

The changes look good and make sense to me. I'd merge this!

@jarmoza jarmoza merged commit 4007e3c into master Oct 12, 2022
@jarmoza jarmoza deleted the file-select-cancel-fix-194 branch October 12, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Cancellation of second data table file selection crashes the landing page
2 participants