fix import from hash dialog #145
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Siderus/Orion!145
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bugfix/import-from-hash-peers-not-loading"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed?
It turns out the peers do load eventually (it's just very slow), but while testing the dialog I found out some other bug: If you change the hash, it no longer tries to get the peers and size, so I move the whole method in the store and called it after the text changed and is valid.
This fixes: https://gitlab.com/siderus/Orion/issues/2
@ -23,2 +23,3 @@this.forceUpdate()this.props.statsStore.check().then(() => { this.forceUpdate() })}Should we add a catch here?
@ -34,0 +59,4 @@return Promise.all([pPeers, pStats]).catch(err => {this.isLoading = falseremote.dialog.showErrorBox('Gurl, an error occurred', `${err}`)What about concurrency?
Should we have a
isLoadingboth here and on line 46, or should we have a.thenright after thePromise.all? What are the pro/cons of this?@ -23,2 +23,3 @@this.forceUpdate()this.props.statsStore.check().then(() => { this.forceUpdate() })}The catch is in the stats store, shows an error dialog
@ -34,0 +59,4 @@return Promise.all([pPeers, pStats]).catch(err => {this.isLoading = falseremote.dialog.showErrorBox('Gurl, an error occurred', `${err}`)I agree, better to handle them in
Promise.allThe behaviour now is a little bit slower:
The "find peers" is a little bit slower than the one that is fetching the size. Before it was loading them asynchronously, now instead we have to wait for both of them to be ready before showing the value.
What do you think of this change?
Hmm, I'll make them resolve async, getting the peers takes way too long
I've reverted the last commit, now they should resolve async, there no concurrency problem though, when one resolves before the other, the other will show
Loading...