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

Makes the camera function optional #66

Merged
merged 22 commits into from
Mar 30, 2022

Conversation

AxelHamburch
Copy link
Contributor

This PR expands the config.ini by asking whether a camera is available and by asking which language you want to use. Only the part with the camera is active here. The language part follows in a subsequent PR.

The function is that you can specify whether a camera is available or not. It is disabled by default as most will have the pocket version. Now that we know that there is no camera, we can also skip or disable functions that only make sense when the camera is active. For example, the page with the query whether LNURL is possible. If not, then the camera has been activated. This site is useless for people without a camera and without a button. So we can skip the function right now and people don't have to laboriously edit this page call in the app.py code anymore.

The next point is the function that is called when the button is pressed 5 times. All wallet data is currently being deleted and there is the option of rescanning the data. But if I don't have a camera, only my data is erased and I have to laboriously re-enter it by hand. That's why we can block this function in the future if you don't have a camera.

Copy link
Contributor Author

@AxelHamburch AxelHamburch left a comment

Choose a reason for hiding this comment

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

Good for me. Tested it several times.

Copy link
Collaborator

@lightisfaster lightisfaster left a comment

Choose a reason for hiding this comment

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

Thanks again for this PR!
Boolean true or false is more common for switch on or off a var (camera).

app.py Outdated
# 2. Offer to cancel and switch to normal scan
# 3. Process payment
if activewallet == "lntxbot":
if activewallet == "lntxbot" and camera == "yes":
Copy link
Collaborator

Choose a reason for hiding this comment

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

boolean true or false is more common

@lightisfaster
Copy link
Collaborator

I've just made a small change for the boolean flag camera.

@lightisfaster lightisfaster merged commit bb69bd7 into 21isenough:master Mar 30, 2022
@AxelHamburch AxelHamburch deleted the add_camera_as_an_option branch March 31, 2022 10:34
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.

2 participants