-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(bridge-ui): preserve custom processing fee selection across components #16346
Conversation
@CodeDragonVN Thanks for your effort and kudos to this very well formatted PR ❤️
|
@KorbinianK, thank you for the acknowledgment! Regarding the processing fee behavior, I see your point about the reset at the first step. However, the current behavior is somewhat inconsistent, as a custom fee or recipient address does not reset, but only selecting the 'None' fee does. The reset of the 'None' fee is arbitrarily caused by the initialization of Here's a screenshot illustrating that the custom fee does not get reset: If the intention is for these settings to reset when returning to the first step, I can implement the logic and make another PR. Just let me know if you'd like me to proceed with those changes. As for the console warning, it indeed appears under the specific circumstance if I omit the default |
@CodeDragonVN |
@KorbinianK, I took a moment to review the implementation in the NFT bridge's ImportStep.svelte and noticed it uses a reset pattern upon mounting: const reset = () => {
foundNFTs = [];
$selectedNFTs = [];
$selectedImportMethod = ImportMethod.NONE;
};
...
onMount(() => {
reset();
}); Inspired by it, I've implemented a similar reset logic for the Fungible Bridge: const reset = () => {
$recipientAddress = null;
$processingFeeMethod = ProcessingFeeMethod.RECOMMENDED;
};
onMount(async () => {
reset();
}); Regarding the previous changes made in this branch, considering that they still enhance the overall code structure and functionality, I believe it would be beneficial to keep them. Please let me know your thoughts on keeping these improvements as part of the branch. I'm open to any further suggestions or modifications you believe might be necessary. |
Congrats, your important contribution to this open-source project has earned you a GitPOAP! GitPOAP: 2024 Taiko Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |
Description
This pull request solves an issue where the processing fee selection is not preserved when navigating between components in the bridge. Specifically, when a user selected 'None' as the processing fee, it would revert to the recommended instead of showing '0 ETH | Customized' after returning to the Import step, unlike when a custom fee was selected and remain at the Import Step.
This happened because
hasEnoughEth
would be set the it's false declaration in ProcessingFee.svelte, since theProcessingFee
component created in TokenInput.svelte wasn't binding thehasEnoughEth
prop, which would then triggerunselectNoneIfNotEnoughETH($processingFeeMethod, hasEnoughEth)
and set theprocessingFeeMethod
to recommended.Changes
hasEnoughEth
prop is correctly bound and passed through to theProcessingFee
component within TokenInput.svelte.How to Reproduce the Issue
Screenshots
hasEnoughEth
prop.