Skip to content

Commit

Permalink
Fix bug on add button.
Browse files Browse the repository at this point in the history
  • Loading branch information
michelleb-stripe committed Feb 2, 2022
1 parent 040b914 commit 78d1113
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ internal class PaymentSheetAddPaymentMethodFragment() : BaseAddPaymentMethodFrag
addPaymentMethodHeader.isVisible = !shouldShowGooglePayButton

sheetViewModel.selection.observe(viewLifecycleOwner) { paymentSelection ->
// Last selection is saved and restore, and when that is google pay it will trigger it
updateErrorMessage(null)
if (paymentSelection == PaymentSelection.GooglePay) {
sheetViewModel.checkout(CheckoutIdentifier.AddFragmentTopGooglePay)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ internal abstract class BaseSheetViewModel<TransitionTargetType>(
* card fragment is determined to be valid (not necessarily selected)
* On [BasePaymentMethodsListFragment] this is set when a user selects one of the options
*/
private val _selection = savedStateHandle.getLiveData<PaymentSelection>(SAVE_SELECTION)
private val _selection = savedStateHandle.getLiveData<PaymentSelection>(
SAVE_SELECTION, savedStateHandle.get(
SAVE_SELECTION
)
)
internal val selection: LiveData<PaymentSelection?> = _selection

private val editing = MutableLiveData(false)
Expand Down

0 comments on commit 78d1113

Please sign in to comment.