Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Commit

Permalink
Check the user is set before filtering transfers
Browse files Browse the repository at this point in the history
This solves issue #11. The error is thrown on load because the user is only set after the dropdown value has changed. This doesn't attempt to filter the transfers if the user hasn't been set.

Signed-off-by: Simon Madine <simon@thingsinjars.com>
  • Loading branch information
thingsinjars authored and Simon Madine committed May 25, 2018
1 parent 5c52ec1 commit 30942a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions LFS171x/sawtooth-material/sawtooth-tuna/client/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ app.refresh = function () {
}
})

// Populate transfer list for selected user
transfers.filter(transfer => transfer.owner === this.user.public)
.forEach(transfer => addAction('#transferList', transfer.asset, 'Accept'))
// Populate transfer list for selected user (if there is a selected user)
if(this.user) {
transfers.filter(transfer => transfer.owner === this.user.public)
.forEach(transfer => addAction('#transferList', transfer.asset, 'Accept'))
}

// Populate transfer select with both local and blockchain keys
let publicKeys = this.keys.map(pair => pair.public)
Expand Down

0 comments on commit 30942a6

Please sign in to comment.