-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support pasting LNURL #593
Conversation
54f7de6
to
5170f43
Compare
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.
If a user copies the the nodeID@ipaddrress:port we do not recognise it being a node ID.
Do we wish to handle this here in C-breez or perhaps the SDK can handle this, what do you think?
Apart from this minor issue
Looks good to me 🥳
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.
Opened an issue in breez-sdk where we can handle this nodeID@address format issue instead breez/breez-sdk-greenlight#299
@erdemyerebasmaz after discussing with the team we decided that handling nodeURI should handle at in C-breez since this is how we do it in Breezmobile. I added this checking in the latest commit 3083a76 |
7cfbfaf
to
3083a76
Compare
I added this logic in the SDK as well: breez/breez-sdk-greenlight#301 If you'd rather use that, then it's no need to handle this in the UI and you can revert the last commit here. |
Awesome. I will revert the latest commit. Thank you🙏 |
f8267c3
to
8c5c246
Compare
0317481
to
222c64c
Compare
Context for latest changes with 222c64c
This caused unwanted behavior such as handling the existing inputData on
Related changes:
|
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.
Looks good!
Tested on android emulator. NodeURI works too 👍
lib/routes/home/home_page.dart
Outdated
@@ -34,17 +34,18 @@ class HomeState extends State<Home> with AutoLockMixin, HandlerContextProvider { | |||
final GlobalKey firstPaymentItemKey = GlobalKey(); | |||
final ScrollController scrollController = ScrollController(); | |||
final handlers = <Handler>[]; | |||
late final InputHandler inputHandler = InputHandler( |
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.
This will break the lifecycle again.
I think SendOptionsBottomSheet
should create its own InputHandler
dealing with the lifecycle there.
A possibility is a duplication of event handling as there will be 2 or more InputHandlers. We should think of a mechanism to avoid that.
|
485e095
to
2101306
Compare
InputHandler changes are reverted and lifecycle issue is resolved. Clipboard item is parsed and passed to InputBloc if it's a supported type. |
- Update breez_translations for unsupported input's error message - Expose parseInput api through InputBloc - Remove utils/lnurl.dart
Handle input on clicking "Paste Invoice or ID" Pass clipboard item to input bloc if it's a supported input type Revert inputHandler changes Display a loader when clipboard data is being retrieved, parsed & handled Close bottom sheet upon clicking 'Paste Invoice or ID' button
2101306
to
88105d4
Compare
This PR addresses
Any input that can be handled by our
InputHandler
is now supported via "Paste Invoice or ID" option.If input data can't be handled(unsupported input type, empty device clipboard)
EnterPaymentInfoDialog
will be displayed so users can manually enter their input.This input will also be validated using
parseInput
API of SDK and checked against supported input types, an"Unsupported input"
error message is shown for unsupported input types(Bitcoin Addresses).Changelist:
InputHandler
"Paste Invoice or ID" andEnterPaymentInfoDialog
breez_translations
for unsupported input's error messageparseInput
API throughInputBloc
utils/lnurl.dart
as it's made obsolete by parsing inputs through SDK