-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix vending card art by fixing pre-caching image #6338
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,6 +219,12 @@ final class PaymentSheetLoader { | |
| elementsSession: elementsSession, | ||
| defaultPaymentMethod: elementsSession.customer?.getDefaultPaymentMethod() | ||
| ) | ||
|
|
||
| // Pre-fetch card art without waiting for this to finish | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you said pre-loading payment option images in general was broken, is that still true?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct in FlowController.swift, |
||
| if let defaultPaymentMethod = paymentOptionsViewModels.stp_boundSafeObject(at: defaultSelectedIndex), | ||
| case .saved(let stpPaymentMethod) = defaultPaymentMethod { | ||
| stpPaymentMethod.preloadCardArtImage(cardArtEnabled: configuration.appearance.cardArtEnabled) | ||
| } | ||
| loadTimings.logEnd("makeViewModels") | ||
|
|
||
| // Send load finished analytic | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the idea was to block this on downloading the card art, since it's already async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing so would slow down this function as well as be inconsistent with the behavior of payment sheet, so I ultimately decided against doing this.