REF: lightning wallet minor refactor#8006
Conversation
Co-authored-by: overtorment <[email protected]>
Co-authored-by: overtorment <[email protected]>
limpbrains
left a comment
There was a problem hiding this comment.
What about Transactions that are alreay in the real store? What existing user will see ?
|
@limpbrains very good findings, thanks! |
| const currentDate = new Date(); | ||
| const now = (currentDate.getTime() / 1000) | 0; // eslint-disable-line no-bitwise | ||
| const invoiceExpiration = updatedUserInvoice.timestamp + updatedUserInvoice.expire_time; | ||
| const invoiceExpiration = (updatedUserInvoice.timestamp ?? 0) + (updatedUserInvoice.expire_time ?? 0); |
There was a problem hiding this comment.
Bug: Invoice Polling Fails on String Prop
The invoice status polling useEffect has two issues: it incorrectly starts when the invoice prop is a string (not yet decoded), as !(invoice as LightningTransaction).ispaid evaluates to true for strings. Furthermore, if an invoice is already paid when the component loads, the polling interval is not cleared and isFetchingInvoices remains true, leading to an incorrect UI state.
|
Wake the fuck up samurai, we have PRs to merge [all PRs for @limpbrains] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/limpbrains |
|
Unbelievable. You, [subject name here], must be the pride of [subject hometown here]! |

I carved out all refactorings from #7961 to deliver separately
additionally, refactoreed
Transactiontype, got rid of.receivein favour of.timestamp. we used to have both, but now we have only one and its definately an integer representing seconds, way less mess. @marcosrdz i also changed all occurances in native code without uderstanding whats going on, so you might want to review those changes extra carefully.i also tried to refactor Transaction & LightningTransaction types and make everything correctly, but this led to a lot of ts complaints all over the codebase so Ill leave it for later