Skip to content

Fix restoring interval from local storage

Remove double initialization of interval in createInitialDonationPaymentValues where the value '0' (coming from the server when there is no URL parameter for the interval, i.e. user started on the payment page) did overwrite the value from localStorage.

Adapt createInitialDonationPaymentValues to return a null/undefined value that will get ignored by the initializePayment action the the store.

This harmonizes the behavior of all payment fields into a common pattern, where the initial value comes from the following sources (in order of importance):

  1. localStorage
  2. URL parameter
  3. Initial value in index.ts of store

Ticket: https://phabricator.wikimedia.org/T324044

Merge request reports

Loading