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 restoring offramp after a refresh #337

Merged
merged 8 commits into from
Dec 23, 2024

Conversation

gianfra-t
Copy link
Contributor

@gianfra-t gianfra-t commented Dec 20, 2024

Solves issue: Stuck after anchor completion.

Copy link

netlify bot commented Dec 20, 2024

Deploy Preview for pendulum-pay ready!

Name Link
🔨 Latest commit 8b6e457
🔍 Latest deploy log https://app.netlify.com/sites/pendulum-pay/deploys/676947cb168e3f000882f239
😎 Deploy Preview https://deploy-preview-337--pendulum-pay.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

setOnSelectedNetworkChange(resetOfframpingState);
}, [setOnSelectedNetworkChange, resetOfframpingState]);
// useEffect(() => {
// setOnSelectedNetworkChange(resetOfframpingState);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not know why the act of passing this function triggers it, even though there is no network change.

@ebma ebma requested a review from a team December 20, 2024 15:34
@@ -129,10 +129,6 @@ export const useMainProcess = () => {
setSigningPhase,
]);

useEffect(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per the previous comment, just setting setOnSelectedNetworkChange(resetOfframpingState); causes it to trigger on mount, which removes a potential state that must be picked up for continuation.

Since the network selector is disabled during the off-ramp, I think we can remove this now.

If we still want to add it back in the future, a potential solution exists in this WIP PR, possible after merging this.

Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Nice catch, you finally found the issue 🙏 Let's merge.

@@ -183,7 +180,16 @@ export const useMainProcess = () => {
// but we intentionally exclude them from the dependency array to prevent unnecessary re-renders.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: We can remove this comment if nothing is missing from the dependency array

@gianfra-t gianfra-t merged commit 6b85d3c into polygon-prototype-staging Dec 23, 2024
5 checks passed
@ebma ebma deleted the fix-restore-offramp branch December 23, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants