feat(LSPS1): Add waiting screen for channels paid from external wallets#3985
feat(LSPS1): Add waiting screen for channels paid from external wallets#3985shubhamkmr04 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the LSPS1PaymentAwait component to poll and display the status of LSPS1 orders, along with necessary navigation updates and localization strings. Feedback includes removing a debug console.log statement, addressing redundant or potentially incorrect back-button handling logic, and adding error handling for asynchronous operations involving Storage.setItem and handleAnything.
| private handleBackPress = (): boolean => { | ||
| return false; | ||
| }; |
There was a problem hiding this comment.
The handleBackPress listener currently returns false, which means it doesn't intercept the back button event and allows the default behavior to proceed. If the intention was to allow the default back navigation, this listener and its registration in componentDidMount and componentWillUnmount are redundant and should be removed. If the intention was to prevent navigation during the polling process, it should return true.
| const oldOrder = JSON.parse(responseArray[index]); | ||
| oldOrder.order = order; | ||
| responseArray[index] = JSON.stringify(oldOrder); | ||
| Storage.setItem(LSPS_ORDERS_KEY, responseArray); |
There was a problem hiding this comment.
Storage.setItem is an asynchronous operation. It should be handled with a .catch() block or await to ensure errors are caught and the operation completes as expected.
Storage.setItem(LSPS_ORDERS_KEY, responseArray).catch((error) => {
console.error('LSPS1PaymentAwait: error saving order', error);
});
| handleAnything(invoice).then(([route, props]) => { | ||
| navigation.navigate(route, props); | ||
| }); |
There was a problem hiding this comment.
handleAnything is an asynchronous function that can throw errors. It is recommended to add a .catch() block to handle potential failures gracefully.
handleAnything(invoice).then(([route, props]) => {
navigation.navigate(route, props);
}).catch((error) => {
console.error('LSPS1PaymentAwait: error handling invoice', error);
});
98f401a to
d793733
Compare
d793733 to
b6b9e23
Compare
8dfe573 to
5c788f5
Compare
…m external wallets
Description
Relates to issue: #3952
This pull request is categorized as a:
Checklist
yarn run tscand made sure my code compiles correctlyyarn run lintand made sure my code didn’t contain any problematic patternsyarn run prettierand made sure my code is formatted correctlyyarn run testand made sure all of the tests passTesting
If you modified or added a utility file, did you add new unit tests?
I have tested this PR on the following platforms (please specify OS version and phone model/VM):
I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):
On-device
Remote
Locales
Third Party Dependencies and Packages
yarnafter this PR is merged inpackage.jsonandyarn.lockhave been properly updatedOther: