-
Notifications
You must be signed in to change notification settings - Fork 195
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: receive back button #2103
fix: receive back button #2103
Conversation
@escapedcat @im-adithya I am closing the other pull request and opening this one in place of it, for a clean working tree. |
🚀 Thanks for the pull request! Here are the current build files for testing: Download and unzip the file for your browser. Refer to the readme for detailed install instructions. This build is brought to you by: Want to sponsor the next build? send some sats to ⚡️builds@getalby.com (don't forget to provide your name) Don't forget: keep earning sats! |
Can you please add me as a collaborator on your fork? |
Sure I don't mind. But may I ask why? |
@im-adithya didn't (doesn't yet?) have the permissions via the Alby team. The Alby team can pushg into your PR. He wanted to support you with the merghe/rebase I believe. |
Ahh! That would be really helpful. But now I have just created new branch and new Pull Request. :) |
@escapedcat Could you provide a review on this PR? |
setPollingForPayment(false); | ||
setInvoice(null); | ||
} | ||
|
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.
We can DRY this up by using a function called
setDefaults() {
setFormData({
amount: "0",
description: "",
expiration: "",
});
setPaid(false);
setPollingForPayment(false);
setInvoice(null);
}
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 do! And welcome back! XD
src/app/screens/Receive/index.tsx
Outdated
@@ -223,7 +238,7 @@ function Receive() { | |||
title={t("title")} | |||
headerLeft={ | |||
<IconButton | |||
onClick={() => navigate("/")} | |||
onClick={handleBack} |
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.
Also, we can use it like this here:
onClick={() => {
invoice ? setDefaults() : navigate("/");
}}
and in the receive again button:
onClick={() => {
setDefaults();
navigate("/receive");
}}
to avoid having handleBack
and receiveAnotherPayment
functions
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.
Done! @im-adithya
Describe the changes you have made in this PR
Changed back button functionality to go back to previous screen rather than home in receive screen.
Link this PR to an issue [optional]
Fixes #1542
Type of change
fix
: Bug fix (non-breaking change which fixes an issue)Screenshots of the changes [optional]
receive.back.button.mp4
How has this been tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist