Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
/ Orion Public archive

Commit

Permalink
fix import from hash -> stats store -> check
Browse files Browse the repository at this point in the history
  • Loading branch information
kernelwhisperer committed Jul 2, 2018
1 parent 3048b9c commit 9088022
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions app/windows/Import/Stores/Stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,18 @@ export class StatStorage {
}
check () {
// Prepare the promise to check the Peers
const pPeers = getPeersWithObjectbyHash(this.hash)
.then(peers => {
console.log('got peers', peers)
this.peersAmount = peers.length
this.isLoading = false
})
this.isLoading = true
this.wasLoadingStats = true
// Prepare the promise to check the stats
const pStats = getObjectStat(this.hash)
.then(stats => {
console.log('got stats')
this.stats = stats
return Promise.all([
getPeersWithObjectbyHash(this.hash),
getObjectStat(this.hash)
])
.then(values => {
this.peersAmount = values[0].length
this.stats = values[1]
this.isLoading = false
})
this.isLoading = true
this.wasLoadingStats = true
return Promise.all([pPeers, pStats])
.catch(err => {
this.isLoading = false
remote.dialog.showErrorBox('Gurl, an error occurred', `${err}`)
Expand Down

0 comments on commit 9088022

Please sign in to comment.