make all sheets on the main body
fix crash when backgrounding the app
This commit is contained in:
@@ -55,7 +55,13 @@ struct HomeView: View {
|
||||
@ObservedObject var viewModel = HomeViewViewModel(addMonthStartWeekdayPadding: false)
|
||||
|
||||
var body: some View {
|
||||
mainView
|
||||
mainView
|
||||
.onAppear(perform: {
|
||||
EventLogger.log(event: "show_home_view")
|
||||
})
|
||||
.sheet(isPresented: $showingSheet) {
|
||||
SettingsView()
|
||||
}
|
||||
.alert(HomeViewViewModel.updateTitleHeader(forEntry: selectedEntry),
|
||||
isPresented: $showUpdateEntryAlert) {
|
||||
ForEach(Mood.allValues) { mood in
|
||||
@@ -82,9 +88,6 @@ struct HomeView: View {
|
||||
showUpdateEntryAlert = false
|
||||
})
|
||||
}
|
||||
.onAppear(perform: {
|
||||
EventLogger.log(event: "show_home_view")
|
||||
})
|
||||
}
|
||||
|
||||
// MARK: functions that do view type work
|
||||
@@ -177,9 +180,7 @@ struct HomeView: View {
|
||||
Image(systemName: "gear")
|
||||
.foregroundColor(Color(UIColor.darkGray))
|
||||
.font(.system(size: 20))
|
||||
}).sheet(isPresented: $showingSheet) {
|
||||
SettingsView()
|
||||
}.padding(.trailing)
|
||||
}).padding(.trailing)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user