mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-12 08:13:26 +01:00
[ADD] Backported dismiss() environment variable to let views dismiss themselves
This commit is contained in:
committed by
Joe Mattiello
parent
0e7083539d
commit
378631e976
@@ -12,6 +12,9 @@ import CoreData
|
||||
|
||||
struct SourcesView: View {
|
||||
|
||||
@Environment(\.dismiss)
|
||||
private var dismiss
|
||||
|
||||
@Environment(\.managedObjectContext)
|
||||
var managedObjectContext
|
||||
|
||||
@@ -102,9 +105,7 @@ struct SourcesView: View {
|
||||
}
|
||||
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
SwiftUI.Button {
|
||||
self.isShowingAddSourceAlert = false
|
||||
} label: {
|
||||
SwiftUI.Button(action: self.dismiss) {
|
||||
Text("Done").bold()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user