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

Spec should include way to control prompts #29

Closed
ianpatton opened this issue Sep 9, 2019 · 1 comment
Closed

Spec should include way to control prompts #29

ianpatton opened this issue Sep 9, 2019 · 1 comment

Comments

@ianpatton
Copy link

ianpatton commented Sep 9, 2019

the spec should provide a way of controlling the prompts that are being displayed.

The provider could keep an array of open prompts, which would allow for the following methods to be exposed:

enum PromptTypes {
enable = "enable",
getInfo = "getInfo",
sendPayment = "sendPayment",
...
}

interface PromptObject {
promptType: PromptTypes;
id: string;
}

  • webln.getPrompts(type?: string): returns Array[PromptObject]
  • webln.closePrompt(id: string)
  • webln.closeAllPrompts()

(Assigning a unique Id in the prompt object allows them to be closed without worrying about things shifting.)

This would help with issues like: joule-labs/joule-extension#232, where the app itself may have more context on the payment than the LND node you are connected to.

It would also help prevent issues where the app may stack up several requests that do not get acknowledged right away, allowing the app to replace the current prompt instead of stacking them.

@wbobeirne
Copy link
Member

This seems pretty harmless, but it is somewhat Joule-centric (Some WebLN providers might completely background the screen while the prompt is active, like on a mobile app) and adds a decent amount of complexity to being a WebLN provider. I think the ideal scenario is to just make issues like the one linked to with Joule less of a problem.

As for stacking requests, that's also another issue I think Joule should be better about. It should either instantly throw if you request too quickly again, or replace the existing window with the new request, instead of opening a new window.

Happy to work with you on the Joule front to ease any issues, I'd like to avoid putting a burden on other developers for any issues that are a problem with Joule specifically.

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

No branches or pull requests

2 participants