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

Refactor default payment method setting #803

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Feb 9, 2024

fix #802

  • fixed warning about component update while rendering another component
  • individual providers no longer need to know if they are the default or not
  • default setting is now handled by WebLNContext -- the same context that returns the provider. this makes a lot more sense and is a lot easier to read (imo)
  • default payment checkbox is now also disabled if there is only one enabled provider or if it is the default provider
2024-02-09.15-27-09.mp4

and I really hate useEffect and loading stuff from local storage now, lol

* fixed warning about component update while rendering another component
* individual providers no longer need to know if they are the default or not
* default setting is now handled by WebLNContext -- the same context that returns the provider. this makes a lot more sense and is a lot easier to read
* default payment checkbox is now also disabled if there is only one enabled provider or if it is the default provider
On page reload, the providers were synced in the order they were loaded.

This means that the default payment provider setting was lost.

Fixed this by syncing order to local storage and on page reload, only syncing providers when they were initialized (else the order would have been lost again).
@ekzyis ekzyis added bug enhancement improvements to existing features labels Feb 9, 2024
@huumn huumn merged commit b3d485e into master Feb 9, 2024
1 check passed
@ekzyis ekzyis deleted the refactor-default-payment-method-setting branch February 14, 2024 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement improvements to existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot update a component ('LNbitsProvider') while rendering a different component ('RawWebLNProvider')
2 participants