Skip to content

Commit

Permalink
Merge pull request #36115 from ZhenjaHorbach/payment-option-reverts-b…
Browse files Browse the repository at this point in the history
…ack-to-pay-with-expensify

Fix bug with Payment option reverts back to 'Pay with Expensify'

(cherry picked from commit caefc6e)
  • Loading branch information
Julesssss authored and OSBotify committed Feb 8, 2024
1 parent f4b61d7 commit 0d61a7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SettlementButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function SettlementButton({

// Put the preferred payment method to the front of the array, so it's shown as default
if (paymentMethod) {
return buttonOptions.sort((method) => (method.value === paymentMethod ? 0 : 1));
return buttonOptions.sort((method) => (method.value === paymentMethod ? -1 : 0));
}
return buttonOptions;
// We don't want to reorder the options when the preferred payment method changes while the button is still visible
Expand Down

0 comments on commit 0d61a7e

Please sign in to comment.