Invalidate tips when user did an action

This commit is contained in:
Marcin Czachurski 2023-10-22 11:43:57 +02:00
parent fb93f547ab
commit a05e9bee48
2 changed files with 4 additions and 0 deletions

View File

@ -200,6 +200,7 @@ private struct NavigationMenuButtons: ViewModifier {
} }
self.hiddenMenuItems = self.displayedCustomMenuItems.map({ $0.viewMode }) self.hiddenMenuItems = self.displayedCustomMenuItems.map({ $0.viewMode })
MenuCustomizableTip().invalidate(reason: .actionPerformed)
} label: { } label: {
Label { Label {
Text(item.title, comment: "Menu item") Text(item.title, comment: "Menu item")

View File

@ -5,7 +5,9 @@
// //
import SwiftUI import SwiftUI
import TipKit
import EnvironmentKit import EnvironmentKit
import WidgetsKit
struct GeneralSectionView: View { struct GeneralSectionView: View {
@Environment(ApplicationState.self) var applicationState @Environment(ApplicationState.self) var applicationState
@ -87,6 +89,7 @@ struct GeneralSectionView: View {
Text("settings.title.menuPosition", comment: "Menu position") Text("settings.title.menuPosition", comment: "Menu position")
} }
.onChange(of: self.applicationState.menuPosition) { oldMenuPosition, newMenuPosition in .onChange(of: self.applicationState.menuPosition) { oldMenuPosition, newMenuPosition in
MainNavigationTip().invalidate(reason: .actionPerformed)
ApplicationSettingsHandler.shared.set(menuPosition: newMenuPosition, modelContext: modelContext) ApplicationSettingsHandler.shared.set(menuPosition: newMenuPosition, modelContext: modelContext)
} }
} }