Instant Purchase #541
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
LBRYCommunity/lbry-desktop!541
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "instant-purchase"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Solves #497.
@kauffj
The entry in the settings page is mostly done. Still needs some state management fixes, and will need feedback on the UI as well:

@kauffj: Once we deal with the above UI issues and the LBC vs. USD issue, this is ready to go. I added an inline comment about the currency stuff.
@ -341,0 +338,4 @@// file manually on their file system, so we need to dispatch a// doLoadVideo action to reconstruct the file from the blobsif (!fileInfo.written_bytes) dispatch(doLoadVideo(uri));If we want to make it possible to have the max instant purchase price be denominated in USD, then we'll have to do a currency conversion here. If not, then we'll have to add an option to FormFieldPrice to disable the currency selector and always use LBC (very easy).
@ -341,0 +338,4 @@// file manually on their file system, so we need to dispatch a// doLoadVideo action to reconstruct the file from the blobsif (!fileInfo.written_bytes) dispatch(doLoadVideo(uri));I believe the app already has the ability to do client side currency conversion, so it shouldn't be too bad.
@ -341,0 +338,4 @@// file manually on their file system, so we need to dispatch a// doLoadVideo action to reconstruct the file from the blobsif (!fileInfo.written_bytes) dispatch(doLoadVideo(uri));Also, make sure to put these in
const/settings.js@ -341,0 +338,4 @@// file manually on their file system, so we need to dispatch a// doLoadVideo action to reconstruct the file from the blobsif (!fileInfo.written_bytes) dispatch(doLoadVideo(uri));Oh, right. OK, I'll make it handle USD. You'd think I would remember that we have client-side currency conversion, given that I wrote the code for it...
So this creates a few more wording issues. The Max Purchase Price section will need to be reworded as well since the options don't make sense without the previous header:
Also, currently the max purchase price section has a totally separate wording when the option is not chosen ("Choose limit"). It sounds like you're saying the new section would have the same wording either way, but the "..." changes into a price field when you choose the option. I guess we would want to keep that consistent betweeen both.
Here's one possibility just as a starting point:
Purchase Settings
--
An upshot of this wording is that neither of them would need helper text to make sense.
Also, we haven't discussed the order of the two sections. It could make sense to flip them, so it's minimum and then maximum.
Some more feedback. I think there is some settings clean up in
v16as well. If you're working on this beforev16makes it into master, you may want to work on it there. Hoping to open PR forv16into master today.@ -343,0 +347,4 @@return Promise.resolve();}const costInfo = makeSelectCostInfoForUri(uri)(state);Settings should be read
selector/settings.js.Should this be it's own conversion promise? Wonder if there is a clean way to do this without a promise.
@ -14,2 +14,4 @@this.state = {instantPurchaseEnabled: props.instantPurchaseEnabled,instantPurchaseMax: props.instantPurchaseMax,Make constants.
These should probably be
FormRowcomponents, and definitely need labels.It seems like there's some kind of caching going on in
lbryio.getExchangeRates(), but even then, there's no guarantee that the exchange rates were refreshed recently. We could have it automatically update into the cache at intervals; then we could changelbryio.getExchangeRates()to be synchronous and directly return a result from the cache (and/or add a function likelbryio.convert()that does the same). Otherwise there's no guarantee that we won't have to go out to the server for this call, so there needs to be a promise or callback.I converted the "disabled" option to a
FormRow. For the second option (where you choose the actual setting), I left it as a div for now. If we made it aFormRow, we would have to stuff the price selector inside the label prop, which feels awkward. The Max Key Fee section also uses a div, I'm guessing for the same reason. Let me know if you'd rather it be inside the label, it's very quick fix.I added helper text in the most recent commit; let me know if you have any adjustments on the wording.
@alexliebowitz made very few additional changes to this, basically just adding labels. You can see here
lbryio/lbry-app@b24b6e2e8eMan do we need better form components!