Skip to content

Commit

Permalink
Fix preferred order of donation frequency.
Browse files Browse the repository at this point in the history
  • Loading branch information
whattherestimefor committed Nov 6, 2024
1 parent a7664de commit a051258
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Mastodon/Scene/Donation/DonationCampaignViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ extension Mastodon.Entity.DonationCampaign: DonationCampaignViewModel {
return .campaign(id: id)
}
var defaultFrequency: DonationFrequency {
return .monthly
return availableFrequencies.last ?? .monthly
}
var defaultCurrency: String {
let fallback = "EUR"
Expand All @@ -135,7 +135,7 @@ extension Mastodon.Entity.DonationCampaign: DonationCampaignViewModel {
}

var availableFrequencies: [DonationFrequency] {
return [.monthly, .oneTime, .yearly].filter {
return [.oneTime, .monthly, .yearly].filter {
suggestedAmounts($0)?.isNotEmpty ?? false
}
}
Expand Down

0 comments on commit a051258

Please sign in to comment.