This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
File input refactor and multi-select shares #141
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merged
Simplify FileInput by moving the filename and error state tracking from FileInput up to FileOrTextInput, because the other use of FileInput (inside ShareInput) explicitly omits the filename rendering anyway. This lets us remove the "hack" described in componentWillReceiveProps, which was intended to propagate the 'clearData' operation to the FileInput's state. Now that the state is in FileOrTextInput, it can be updated directly. This is the first in a series of changes inteded to generalize and refactor FileInput in an effort to support selecting multiple share files at once. It doesn't make sense for FileInput to track the state of a list of files, since it's not designed to render multiple filenames.
This generalizes FileInput so that it always passes an array of one or more files to it's onChange property, rather than just the attributes of a single file. The onChange listeners are updated to handle an array instead of a single file. This is another incremental step towards handling multiple shares selected at the same time.
Now that the RecoverScreen expects an array of file-like objects, the 'Copy from clipboard' button handler needs to massage its input a bit. This also prevents the ShareStatus from displaying 'undefined' as the filename for pasted shares, instead showing 'Copied from clipboard'.
Rebased! 🎉 |
@liliakai Please confirm:
Do I have that right? Will prioritize review of this PR over #127 if so. |
Correct on both counts. |
conorsch
approved these changes
Oct 1, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as advertised! Confirmed recovery via multiselect of several shards.
This was referenced Oct 1, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Status
Ready for review
Description of Changes
Refactors recover duck to handle multiple files at once and enable multi-select.
Testing
Probably easiest to test this after fix-tests branch is merged to fix the unit tests.