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

[VSP] save last used VSP host #2789

Merged
merged 6 commits into from
Oct 28, 2020
Merged

Conversation

bgptr
Copy link
Collaborator

@bgptr bgptr commented Oct 26, 2020

This update saves the last used VSP host to config after a successful ticket purchase on the new VSP page and sets the VSPSelects when the user arrives next time.
Closes #2763

Copy link
Member

@vctt94 vctt94 left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.

The vsp should be a wallet config and not a global config, as each wallet can have different vsps selected, as default.

@bgptr
Copy link
Collaborator Author

bgptr commented Oct 26, 2020

Thank you for the review.
I moved the vsp_host param to the wallet config.

@degeri
Copy link
Member

degeri commented Oct 26, 2020

can we have this as an optional clickable setting ? worried about centralization risks here. We want people to feel like they can choose any VSP they want.

@vctt94
Copy link
Member

vctt94 commented Oct 26, 2020

I think that's a valid point @degeri. Maybe we can have a checkbox near the ticket purchase area saying use default. What do you think @bgptr ?

@bgptr
Copy link
Collaborator Author

bgptr commented Oct 26, 2020

@vctt94 @degeri Sure thing, I have added the checkbox.

@jholdstock
Copy link
Member

I've tried out the checkbox, I like the idea but it needs refining. I suggest

  • Checkbox label should read "Always use this VSP"
  • If no VSP is selected (ie. the dropdown says "Select VSP...") the checkbox should be hidden/deactivated. When a VSP is selected, checkbox appears/activates.
  • When the checkbox is checked, the dropdown is deactivated to indicate that the value can not be changed. Checkbox must be unchecked again before dropdown value can change.

@bgptr
Copy link
Collaborator Author

bgptr commented Oct 27, 2020

@jholdstock I like your suggestions. I've implemented them.

@jholdstock
Copy link
Member

Looking better but it seems like the selected vsp and checkbox are resetting when I closed/reopen decrediton.

Edit: Actually, I dont even need to restart decrediton. Just opening a new tab resets the values.

@bgptr
Copy link
Collaborator Author

bgptr commented Oct 27, 2020

@jholdstock You are right. Probably it's because I saved the VSP host only after successful ticket purchasing.

I revamped (and also cleaned up) the code to save immediately after clicking on the checkbox.
It's more user-friendly now. Thank you.

@vctt94
Copy link
Member

vctt94 commented Oct 27, 2020

needs rebase

@bgptr
Copy link
Collaborator Author

bgptr commented Oct 27, 2020

rebased

Copy link
Member

@vctt94 vctt94 left a comment

Choose a reason for hiding this comment

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

I think that's a good start and we can iterate from here. Thanks @bgptr

@alexlyp alexlyp merged commit 6d30207 into decred:master Oct 28, 2020
@bgptr bgptr deleted the save-last-used-vsp-host branch February 9, 2021 18:42
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.

Remember last used VSP
5 participants