Skip download if the user didn't select a dir, fix StorageList's checkboxes #102

Merged
kernelwhisperer merged 3 commits from bugfix/108-cannot-read-property-0-of-undefined into master 2018-05-10 03:13:06 -04:00
kernelwhisperer commented 2018-05-09 05:02:44 -04:00 (Migrated from github.com)

What changed?

Fixed https://dev.siderus.team/issues/108 (Cannot read property '0' of undefined)

While working on this I found 2 more bugs, one of which I fixed:

  1. When I select a second element, this.props.storageStore.selected.length is actually 0, because the equality check fails (it thinks it's the same element), therefore clicking 'Download' after checking 2 items did nothing.

  2. (not fixed) When downloading more than 1 item, the loading wheel never disappears even though the files were saved. I dug a bit into this and it looks like when we call saveFileToPath twice, the promise resolves only once. My fear is that we can't use IPFS_CLIENT.files.getReadableStream(hash) concurrently ... thoughts?

## What changed? Fixed https://dev.siderus.team/issues/108 (Cannot read property '0' of undefined) While working on this I found 2 more bugs, one of which I fixed: 1. When I select a second element, `this.props.storageStore.selected.length` is actually 0, because the equality check fails (it thinks it's the same element), therefore clicking 'Download' after checking 2 items did nothing. 2. (not fixed) When downloading more than 1 item, the loading wheel never disappears even though the files were saved. I dug a bit into this and it looks like when we call `saveFileToPath` twice, the promise resolves only once. My fear is that we can't use `IPFS_CLIENT.files.getReadableStream(hash)` concurrently ... thoughts?
koalalorenzo commented 2018-05-10 02:58:23 -04:00 (Migrated from github.com)

In case the directories already exists the Promise Chain fails.
We should probably skip errors when creating directories:

Error: EEXIST: file already exists, mkdir '/Users/koalalorenzo/Downloads/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv'

https://sentry.io/siderus-opensource/orion/issues/552911163/
I will create a new task for this.

In case the directories already exists the Promise Chain fails. We should probably skip errors when creating directories: ``` Error: EEXIST: file already exists, mkdir '/Users/koalalorenzo/Downloads/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv' ``` https://sentry.io/siderus-opensource/orion/issues/552911163/ I will create a new task for this.
koalalorenzo (Migrated from github.com) approved these changes 2018-05-10 02:58:47 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Siderus/Orion!102
No description provided.