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

Commit 30942a6

Browse files
thingsinjarsSimon Madine
authored andcommitted
Check the user is set before filtering transfers
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 <[email protected]>
1 parent 5c52ec1 commit 30942a6

File tree

1 file changed

+5
-3
lines changed
  • LFS171x/sawtooth-material/sawtooth-tuna/client/src

1 file changed

+5
-3
lines changed

LFS171x/sawtooth-material/sawtooth-tuna/client/src/app.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ app.refresh = function () {
4949
}
5050
})
5151

52-
// Populate transfer list for selected user
53-
transfers.filter(transfer => transfer.owner === this.user.public)
54-
.forEach(transfer => addAction('#transferList', transfer.asset, 'Accept'))
52+
// Populate transfer list for selected user (if there is a selected user)
53+
if(this.user) {
54+
transfers.filter(transfer => transfer.owner === this.user.public)
55+
.forEach(transfer => addAction('#transferList', transfer.asset, 'Accept'))
56+
}
5557

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

0 commit comments

Comments
 (0)