Improve type checking for card verify #2057
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#2057
Loading…
Reference in a new issue
No description provided.
Delete branch "types/cardverify"
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?
Improved type checking for CardVerify component.
Thanks for the PR! 🙂
We don't need the two classes you added (they aren't adding any types), but the other fixes you added are valid. Make sure to check out our contributing document.
Can we send you some LBC as appreciation?
@ -10,0 +20,4 @@
close: Function,
};
}
We don't need these. They aren't doing anything as is. Also I belive the
declare class
syntax is wrong.@ -10,0 +20,4 @@
close: Function,
};
}
Thank you for your feedback.
The classes are types for the global
CardVerify
object that you are accessing after adding the script. Not declaring classes for them results in Flow errorsCannot resolve name CardVerify.
Cannot resolve name StripeCheckout.
As this is a global variable, it would make sense in my opinion to also declare a global class like suggested here: https://flow.org/en/docs/libdefs/creation/#toc-declaring-a-global-class
The goal of my changes was to eliminate the lint & flow errors and therefore I added class definitions for the accessed global objects.
@ -10,0 +20,4 @@
close: Function,
};
}
Ah you are right! I missed the part where we access
CardVerify
when I first looked this over. Thanks for that link too 🙂 I'll definitely read over that.Thanks again for the PR! If you haven't yet, make sure to check out the contributing guide.
Can we send you some LBC as appreciation?
@seanyesmunt Not needed, thank you :)
@amelzer how about an exclusive LBRY Hacktoberfest t-shirt? Shoot us an email at hello@lbry.io so we can get the form over to you :)
@amelzer I reverted your PR. I guess I didn't look close enough but upon testing Tom noticed it was breaking the app. I can now see it was because of your variable name changes.
CardVerify.stripeHandler
is supposed to reference the component, not the type. We could change that tothis.stripeHandler
.@seanyesmunt Thanks for letting me know. I will create a new PR