-
Notifications
You must be signed in to change notification settings - Fork 973
Fix QR codes not displaying for new wallets #11496
Conversation
… data Fixes #11492 Auditors: @NejcZdovc
Problem was introduced with c965002#diff-3cdfdb124f718787d584e9e2b82fcedcR1720 via #11457 When reviewing, we need to make sure this issue is still solved: |
Codecov Report
@@ Coverage Diff @@
## master #11496 +/- ##
==========================================
+ Coverage 52.5% 52.53% +0.03%
==========================================
Files 268 268
Lines 25241 25218 -23
Branches 4028 4023 -5
==========================================
- Hits 13252 13248 -4
+ Misses 11989 11970 -19
|
app/browser/api/ledger.js
Outdated
@@ -1717,7 +1717,7 @@ const onWalletProperties = (state, body) => { | |||
|
|||
// unconfirmed amount | |||
const unconfirmed = parseFloat(body.get('unconfirmed')) | |||
if (unconfirmed >= 0) { | |||
if (unconfirmed > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is not correct, because you could have wallet that have unconfirmed balance, let's say 10$. Then you import wallet from the backup, which have unconfirmed balance 0. New value will not be saved.
Another use case is when your unconfirmed balance is handled, you can't hide that message, because 0 will not be saved.
This return
in the if block is more or less from the old code. What I would do is to change it to
const unconfirmed = parseFloat(body.get('unconfirmed'))
if (unconfirmed >= 0) {
state = ledgerState.setInfoProp(state, 'unconfirmed', unconfirmed)
if (clientOptions.verboseP) {
console.log('\ngetBalance refreshes ledger info: ' + ledgerState.getInfoProp(state, 'unconfirmed'))
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
want to just PR an alt fix @NejcZdovc ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will push to this PR
@bbondy @bsclifton pushed a fix that removes return statements. Please check if everything is ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change pushed
Very nice- thanks, @NejcZdovc 😄
|
Fix QR codes not displaying for new wallets
Fix QR codes not displaying for new wallets
Fix QR codes not displaying for new wallets
Fix unconfirmed funds check which prevented code from setting payment data
Fixes #11492
Auditors: @NejcZdovc
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests