Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pending details missing - Closes #1269 #1273

Merged
merged 4 commits into from
Sep 14, 2018

Conversation

michaeltomasik
Copy link
Contributor

What issue have I solved?

-- #1269

How have I implemented/fixed it?

Checking for a pending transaction if there is no any in transaction store

How has this been tested?

Review checklist

@michaeltomasik michaeltomasik self-assigned this Sep 10, 2018
@Efefefef Efefefef added this to Pull Requests in Version 1.3.0 via automation Sep 11, 2018
@slaweet
Copy link
Contributor

slaweet commented Sep 12, 2018

Is this in progress?
I see a problem here:
https://jenkins.lisk.io/test/lisk-hub/PR-1273/#/explorer/accounts/15610359283786884938L?id=6056272648002006847
Compared to base branch:
https://jenkins.lisk.io/test/lisk-hub/1.3.0/#/explorer/accounts/15610359283786884938L?id=6056272648002006847

I thought the described problem is just in Wallet, so account page should not be affected, bu you are solving more than described in the issue.

Copy link
Contributor

@slaweet slaweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some refactoring suggestions below

Also, reading pendingTransactions in this component doesn't feel good. I would rather see the transaction object as something coming from the parent component.

Overall, this file is huge and worth some refactor. So I approve this PR. And I created a follow-up refactoring task #1282

(this.props.pendingTransactions.find(tx => tx.id === transactionId) || {});

const isSendTransaction = this.props.transaction.type === transactions.send
|| (this.props.pendingTransactions && this.props.pendingTransactions.length > 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what is the goal, but logic here seems wrong. if there are some pending transactions, it doesn't mean that they are of "send" type.

const transaction = isTransactionEmpty || (isTransactionEmpty &&
this.props.pendingTransactions.find(tx => tx.id === transactionId)) ?
this.props.transaction :
(this.props.pendingTransactions.find(tx => tx.id === transactionId) || {});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same 4 lines again on line 143. Would be worth a helper function.

Copy link
Contributor

@Efefefef Efefefef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool

@michaeltomasik michaeltomasik merged commit 79d0cb3 into 1.3.0 Sep 14, 2018
Version 1.3.0 automation moved this from Pull Requests to Merged Pull Requests Sep 14, 2018
@michaeltomasik michaeltomasik deleted the 1269-pending-transaction-details branch September 14, 2018 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Version 1.3.0
  
Merged Pull Requests
Development

Successfully merging this pull request may close these issues.

None yet

3 participants