diff --git a/OBAKit/Controls/Navigation/RenamableNavigationTitle.swift b/OBAKit/Controls/Navigation/RenamableNavigationTitle.swift index c410252f..5d5d9fea 100644 --- a/OBAKit/Controls/Navigation/RenamableNavigationTitle.swift +++ b/OBAKit/Controls/Navigation/RenamableNavigationTitle.swift @@ -34,10 +34,10 @@ fileprivate struct RenamableNavigationTitle: ViewModifier { // way to have an `onChange` to fire on initial value. textFieldValue = title } - .onChange(of: title) { newValue in + .onChange(of: title) { _, newValue in textFieldValue = newValue } - .onChange(of: isEditing) { newIsEditing in + .onChange(of: isEditing) { _, newIsEditing in isFocusedOnTextField = newIsEditing } } diff --git a/OBAKit/Donations/DonationLearnMoreView.swift b/OBAKit/Donations/DonationLearnMoreView.swift index f6652230..2fc174eb 100644 --- a/OBAKit/Donations/DonationLearnMoreView.swift +++ b/OBAKit/Donations/DonationLearnMoreView.swift @@ -76,7 +76,7 @@ struct DonationLearnMoreView: View { .alert("Enter an amount in U.S. dollars", isPresented: otherAmountSelected) { buildOtherAmountAlert() } - .onChange(of: donationModel.donationComplete) { newValue in + .onChange(of: donationModel.donationComplete) { _, newValue in guard newValue else { return } let shouldDismiss: Bool diff --git a/OBAKit/Onboarding/RegionPicker/RegionPickerView.swift b/OBAKit/Onboarding/RegionPicker/RegionPickerView.swift index c674383a..111cf83c 100644 --- a/OBAKit/Onboarding/RegionPicker/RegionPickerView.swift +++ b/OBAKit/Onboarding/RegionPicker/RegionPickerView.swift @@ -79,11 +79,11 @@ public struct RegionPickerView: View, OnboardingView { // Lifecycle-related modifiers .onAppear(perform: setCurrentRegionIfPresent) - .onChange(of: regionProvider.currentRegion) { [regionProvider] _ in + .onChange(of: regionProvider.currentRegion, initial: false) { _, newRegion in // When the user selects to automatically select a region, update // selectedRegion with the new current region. if regionProvider.automaticallySelectRegion { - self.selectedRegion = regionProvider.currentRegion + self.selectedRegion = newRegion } }