File select cancellation fix + condition cleanup #197
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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
infile-selector.vue
.)I also cleaned up some conditional checks for possible values of the file data variable
fileInput
infile-selector
. It's eithernull
or has a valid value. And I removed the file-select event propagating back up toindex.vue
that was using the string"none"
to indicate a file selection cancellation.